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(引 ...
随机推荐
- Quartz.net一个简要示例
下面描述了一个Quartz.net最常用的应用场景,按特定秒数触发执行特定任务. 1.任务要继承自:IJob,在Execute方法中填入自己需要执行的任务. public virtual void E ...
- 网络编程socket
socket socket解释 socket通常也称作"套接字",用于描述IP地址和端口,是一个通信链的句柄. 应用程序通常通过"套接字"向网络发出请求或者应答 ...
- Error Dropping Database (Can't rmdir '.test\', errno: 17)
MySql 删除数据库出错:Can't rmdir '.\test\', errno: 17 到test数据下的所在的目前data\test目录,删除掉所有的文件后,就可以删除数据了
- HYSBZ 1036 【树链剖分】
思路: 裸裸的树链剖分.... 树链剖分就是把一棵树分成若干重链和轻链...然后保证形成的线段树上每条链是连续存储的.然后这样就能用线段树进行维护了. 但是每次一定要保证是在同一条链里边....思路就 ...
- Words in Coding Theory
Lemma d(x.y) wt(c,0) self-dual self-orthogonal even prime wt(C) matrix column permute permutation ge ...
- 《Code Complete》ch.29 集成
WHAT? 集成是这样一种软件开发行为:将一些独立的软件组合为一个完整的系统. WHY? 更容易诊断缺陷 尽早获得一个可工作的产品 更好的顾客关系 增强士气 更可靠地估计进度表 更准确的现状报告 HO ...
- Codeforces Round #219 (Div. 2) B. Making Sequences is Fun
B. Making Sequences is Fun time limit per test 2 seconds memory limit per test 256 megabytes input s ...
- XGBoost参数
XGBoost参数 转自http://blog.csdn.net/zc02051126/article/details/46711047 在运行XGboost之前,必须设置三种类型成熟:general ...
- [译] Closures in Lua - Lua中的闭包
原文:(PDF) . 摘要 一等(first-class)函数是一种非常强大的语言结构,并且是函数式语言的基础特性.少数过程式语言由于其基于栈的实现,也支持一等函数.本文讨论了Lua 5.x用于实现一 ...
- 查看Eclipse版本号的方法
查看Eclipse版本号的方法如下所示: 1:假设Eclipse已打开Eclipse的菜单栏: Help-->About Eclipse弹出框中会显示一排logo,点击eclipse的那个log ...