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(引 ...
随机推荐
- C++学习36 string类和字符串
C++大大增强了对字符串的支持,除了可以使用C风格的字符串,还可以使用内置的数据类型 string.string 类处理起字符串来会方便很多,完全可以代替C语言中的 char 数组或 char 指针. ...
- [SQL]CASE用户数据统计
create table tb(id int ,class varchar)--class种类就只有三种,如果不固定就需要存储过程来实现 insert tb ,'a' union all ,'a' u ...
- HDU 3535 【背包】
题意: 给出n组数据,每组数据有一个类型. 0代表至少选择一个,1代表至多选择一个,2代表任意选择. 给出背包容量. 如果背包不能满足最基本的要求输出-1. 思路: 背包问题变相考察~ 当0的时候初始 ...
- 1314: ZZY的困惑
1314: ZZY的困惑 Time Limit: 2 Sec Memory Limit: 128 M[Submit][Status][Web Board] Description ZZY有很多爱好~ ...
- RequireJS API
可以找到许多的解读,但是原文总是最重要的,也是最正宗的说明,直接访问 RequireJS 有时不太方便,这里将 RequireJS 2.0 API 的原文转载到博客园,方便查看. This is th ...
- pytest学习笔记(三)
接着上一篇的内容,这里主要讲下参数化,pytest很好的支持了测试函数中变量的参数化 一.pytest的参数化 1.通过命令行来实现参数化 文档中给了一个简单的例子, test_compute.py ...
- 【练习】显示MYSQL客户机选项
[oracle@enmo ~]$ mysql --help mysql Ver , for Linux (x86_64) using EditLine wrapper Copyright (c) , ...
- 多线程查询FTP Server上的文件
情形是这样的,最近做一个自动化的项目,当batch跑成功了,FTP Server上会有特定的生成文件.但是不确定是什么时候会有,大概是batch跑完了5分钟之内吧,所以在脚本里设置检查点的时候,需要每 ...
- APP发布Xcode7
一.准备工作 1>准备3.5寸.4寸.4.7寸.5.5寸的程序截图至少个1张,如果支持iPad,那么iPad截图也要有.这些截图尽量截取页面漂亮的,因为这些截图是要放在AppStore中展示的. ...
- socket学习笔记——实现收发文件(Windows)
记录下来,供自己学习! server.c #define _CRT_SECURE_NO_DEPRECATE #include <stdio.h> #include <stdlib.h ...