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(引 ...
随机推荐
- oracle新建数据库时怎么选择编码格式
源地址:https://zhidao.baidu.com/question/2009631596107727508.html 启动database configuration assistant,创建 ...
- NFS挂载启动
NFS挂载启动参数: 1.服务器IP.目录(虚拟机IP和 NFS目录) 2.开发的IP 如下我的开发板设置 ipaddr=192.168.1.17 ① 开发板IP serverip ...
- 64位Linux编译hadoop-2.5.1
Apache Hadoop生态系统安装包下载地址:http://archive.apache.org/dist/ 软件安装目录:~/app jdk: jdk-7u45-linux-x64.rpm ha ...
- JavaScript对象的创建之工厂方法
通过工厂的方式来创建Person对象,在createPerson中创建一个对象,然后为这个对象设置相应的属性和方法,之后返回这个对象. function createPerson(name, age) ...
- ubuntu设置vim语法高亮显示和自动缩进
转自:http://nichael1983.blog.163.com/blog/static/114969433201002711850604/ 今天自己学习使用vim,当我在vim中输入程序时,默认 ...
- java的文件流:字节流(FileInputStream、FileOutputStream)和字符流(FileReader、FileWriter)。
java的输入输出建立在4个抽象类的基础上:InputStream.OutputStream.Reader.Writer.InputSream和OutputStream被设计成字节流类,而Reader ...
- The BKS System for the Philco-2000 学习笔记
最近因为学业需要阅读这一篇论文......一把鼻涕一把泪地翻了一边以求更好地理解,谁让我英语渣呢....有很多地方翻译得感觉还是有问题或者不流畅,还请大家多多指教. The BKS System fo ...
- Orchard官方文档翻译(六) 建立你的第一个Orchartd站点
让我们开始 该主题内容已在Orchard1.8Release版本下测试通过. 这里通过向导式的教程来告诉大家Orchard的功能如何使用.如果你是第一次使用Orchard,该文档就是为你而准备的! O ...
- Linux 串口使用
1. 安装串口调试工具minicom sudo apt-get install minicom 2. 查看串口端口 cfm@cfm880:~$ dmesg | grep tty[ 0.000000] ...
- bzoj1216 [HNOI2003]操作系统
1216: [HNOI2003]操作系统 Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 751 Solved: 419[Submit][Status ...