Copying Rowsets
I find that you often need to create and manipulate standalone rowsets. Sometimes you can get the data for your standalone rowset from the database using the Fill method, however sometimes you'll want to copy from existing rowsets. This is where the CopyTo method comes in handy.
However there is one important thing to note when using CopyTo - it will only copy like-named record fields and subscrolls at corresponding levels
In order to work correctly, the record in the source rowset must have the same name as the record in target rowset, unless you specify a record list in the parameters.
For instance, say I have data in a rowset &rsExample with one record, EXAMPLE which is populated in the component buffer.
The EXAMPLE record has the following fields:
- EMPLID
- NAME
Now, say I want to copy the data from my rowset &rsExample to another rowset, &rsExampleAudit which consists of an audit record forEXAMPLE called AUDIT_EXAMPLE.
The AUDIT_EXAMPLE record has the following fields:
- AUDIT_OPRID
- AUDIT_STAMP
- AUDIT_ACTN
- EMPLID
- NAME
What I want is to copy the like-name fields between &rsExample and &rsExampleAudit (the fields EMPLID and NAME).
The following code will NOT work:
Why? Because &rsExample consists of a record named EXAMPLE, but &rsExampleAudit consists of a record named AUDIT_EXAMPLE. Because the two rowsets do not have the same underlying record name, the copy does absolutely nothing (quite frustrating!).
In this scenario, we need to specify a record list, so it knows the source and target record names. This how I need to write this code to make it work:
Generically the syntax is:
Copying Rowsets的更多相关文章
- 14——小心copying行为
资源的copying行为决定对象的copying行为. 抑制copying行为,使用引用计数.
- UVa 714 Copying Books(二分)
题目链接: 传送门 Copying Books Time Limit: 3000MS Memory Limit: 32768 KB Description Before the inventi ...
- Effective C++ -----条款14: 在资源管理类中小心copying行为
复制RAII对象必须一并复制它所管理的资源,所以资源的copying行为决定RAII对象的copying行为. 普遍而常见的RAII class copying行为是:抑制copying(使用私有继承 ...
- ACM: Copying Data 线段树-成段更新-解题报告
Copying Data Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Description W ...
- 抄书 Copying Books UVa 714
Copying Books 题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=85904#problem/B 题目: Descri ...
- Copying Fields to a new Record
This is a time saving tip for application designer. If you are creating a new record definition and ...
- UVA 714 Copying Books 二分
题目链接: 题目 Copying Books Time limit: 3.000 seconds 问题描述 Before the invention of book-printing, it was ...
- poj 1505 Copying Books
http://poj.org/problem?id=1505 Copying Books Time Limit: 3000MS Memory Limit: 10000K Total Submiss ...
- [Effective C++ --014]在资源管理类中小心copying行为
第一节 <背景> 条款13中讲到“资源取得的时机便是初始化时机”并由此引出“以对象管理资源”的概念.通常情况下使用std中的auto_ptr(智能指针)和tr1::shared_ptr(引 ...
随机推荐
- struts (一)
1.jar 2.web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app id=&quo ...
- MPlayer在ARM上的移植(S5PV210开发板)
MPlayer 1.0已经把大部分解码库都自带了,如ffmpeg,但是自带的音频库在S5PV210下效果非常不好.换成使用libmad效果不错.因此MPlayer 在ARM-Linux的最简单的移植只 ...
- silverlight,动态数据集合中,移除动态集合自身的内容
在xaml的页面上创建一个x:Name为_list1的ListBox,其中ListBox里面的每一项是ListBoxItem if (_list1.SelectedItem == null)//如果_ ...
- Android wifi状态三种广播
public class NetworkConnectChangedReceiver extends BroadcastReceiver{ @Override public voi ...
- Linux下软件安装,卸载,管理
一. 软件安装包的类型 通常Linux应用软件的安装有五种: 1) tar+ gz包,如software-1.2.3-1.tar.gz. 他是使用UNIX系统的打包工具tar打包的. 2) r ...
- 用Ossim管理IT资产(视频)
用Ossim管理IT资产 在Ossim中集成了Ocs Server,OCS用于帮助网络或系统管理员来跟踪网络中计算机配置与软件安装情况的应用程序.收集到硬件和系统信息,OCS Inventory 也可 ...
- C++: std::string 与 Unicode 结合
一旦知道 TCHAR 和_T 是如何工作的,那么这个问题很简单.基本思想是 TCHAR 要么是char,要么是 wchar_t,这取决于_UNICODE 的值: // abridged from tc ...
- NSBundle 的使用
NSBundle 读取图片 plist text NSBundle *mainbundle=[NSBundle mainBundle]; //使mainBundle 对象获取图片的路径 NSStrin ...
- 創建HTTP 服務器
var http = require('http'); var fs = require('fs'); var server = http.createServer(function(req, res ...
- Artifacts Gallery - Seahorse Collector, The
Artifacts Gallery - Seahorse Collector, The