在Delphi中怎样使用SQL*PLUS中的Copy命令

luhongjun 2010-07-29 03:35:06
SQL*PLUS中的copy是一功能非常强大的数据复制命令.它虽然可以在sql>提示符下使用,但不属于SQL语句,因此,Delphi中的的ADOQUERY组件不能直接使用.要想使用这个copy命令,在Delphi中应该怎样完成.

copy的命令格式:
COPY {FROM database | TO database | FROM database TO database} {APPEND|CREATE|INSERT|REPLACE} destination_table [(column, column, column, ...)]
USING query

...全文
116 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
kye_jufei 2010-07-30
  • 打赏
  • 举报
回复
如果說:
set Copycommit 1
Set arraySize 100
Copy from username/password@dbname-
to username1/pw1@dbname1-
append Tablename-
Using Select * from Tablename1

在sql/plus里前几次执行时报错:

ORA-01458: 内部变量字符串长度非法。

那麼可能的原因就是:


ORA-01458 invalid length inside variable character string

Cause An attempt was made to bind or define a variable character string with a buffer length less than the two-byte minimum requirement.
Action Increase the buffer size or use a different type.


解決方法:

增加初始化参数db_block_buffers(在init.ora文件里面),改完后,重新启动数据库...


kye_jufei 2010-07-30
  • 打赏
  • 举报
回复
這樣試試...

copy from username/password@dbname
to username1/pw1@dbname1
append(create/insert/replace) tablename(col1,col2...)
using select....from ...;
append:添加到表上,如果tablename表不存在,则建立此表
create:如果tablename表存在,则出错
insert:添加到表中,如果tablename表不存在,则出错
replace:替换表中数据,如果tablename表不存在,则建立此表...
kye_jufei 2010-07-30
  • 打赏
  • 举报
回复
方法一:
建議先建立一個DBLINK,然後再寫存儲過程直接調用...

1)把你要做的工作写成脚本,甚至你可以在程序中动态生成你的脚本,假定保存为c:\a.sql
2)在Delphi中用ShellExecute执行该脚本,参数为sqlplus internal/oracle@server @c:\a.sql
FastReport.v4.9.81 for.Delphi.BCB.Full.Source企业版含ClientServer文修正版 delphi2010文完美支持。 D2010安装必读 delphi2010使用者安装时,请将res\frccD14.exe更名名为frcc.exe frccD14.exe 是专门的delphi2010编码器。其他delphi版本,请使用frcc.exe FASTREPORT® 4.9 VCL - report generator for Delphi CURRENT VERSION Build: 4.9.81 Date: 05/31/10 FastReport®4 VCL is an add-on component that allows your application to generate reports quickly and efficiently. FastReport® provides all the necessary tools to develop reports, including a visual report designer, a reporting core, and a preview window. It can be used in the CodeGear (exBorland) Delphi 4-2010, CodeGear C++Builder 6-2010 and CodeGear RAD Studio environments What's new in the FastReport 4 Report Designer: new XP-style interface the "Data" tab with all report datasets ability to draw diagrams in the "Data" tab code completion (Ctrl+Space) breakpoints watches report templates local guidelines (appears when you move or resize an object) ability to work in non-modal mode, mdi child mode Report Preview: thumbnails Print: split a big page to several small pages print several small pages on one big print a page on a specified sheet (with scale) duplex handling from print dialogue print copy name on each printed copy (for example, "First copy", "Second copy") Report Core: "endless page" mode images handling, increased speed the "Reset page numbers" mode for groups reports crypting (Rijndael algorithm) report inheritance (both file-based and dfm-based) drill-down groups frxGlobalVariables object "cross-tab" object enhancements: improved cells appearance cross elements visible in the designer fill corner (ShowCorner property) side-by-side crosstabs (NextCross property) join cells with the same value (JoinEqualCells property) join the same string values in a cell (AllowDuplicates property) ability to put an external object inside cross-tab AddWidth, AddHeight properties to increase width&height of the cell AutoSize property, abilit
RX Library 2.75 with Delphi 2009 support (by FlexGraphics software) ====================================================================== The Set of Native Delphi Components for Borland Delphi versions 1, 2, 3, 4, 5, 6, 7, 2005, 2006, 2009 and Borland C++ Builder 1, 3, 4, 5, 6, 2006 & 2009. 100% Source Code. Last revision date Oct 12, 1999. PLEASE FOLLOW THE INSTRUCTIONS PROVIDED IN THE INSTALLATION SECTION! TABLE OF CONTENTS ----------------- Latest Changes Overview History License Agreement Installation Demonstration Programs Source Files Using GIF Images Copyright Notes NEW FOR VERSION 2.75 -------------------- Delphi 5.0 & C++Builder 4.0 Compatibility New components: TRxLoginDialog New properties, events: TFormPlacement.RegistryRoot TFormPlacement.Version TFontComboBox.UseFonts TRxDBGrid.OnTopLeftChanged TRxDBLookupCombo.DisplayValues TStrHolder.Macros, TStrHolder.OnExpandMacros RxSpin.TValueType.vtHex New routines, methods, constants: SaveClipboardToStream, LoadClipboardFromStream (clipmon.pas) AppFileName, AppVerInfo (rxverinf.pas) XorString, XorEncode, XorDecode (strutils.pas) BUG FIXES. Overview -------- This version is the result of long unactivity of RX Library authors and some imperfections and bugs of other RX adaptations to Delphi 6. The authors of this version disclaim all warranties as to this software, whether express or implied, including without limitation any implied warranties of merchantability or fitness for a particular purpose. Use under your own responsibility, but comments (even critique) in English (or in Russian) are welcome. RX Library contains a large number of components, objects and routines for Borland Delphi with full source code. This library is compatible with Borland Delphi 1, 2, 3, 4, 5, 6 and Borland C++ Builder 1, 3, 4. This collection includes over 60 native Delphi components. RX Library is a freeware product. Feel free to distribute the library as long as all files are unmodified and kep
RX Library 2.75 =============== The Set of Native Delphi Components for Borland Delphi versions 1, 2, 3, 4 & 5 and Borland C++ Builder 1, 3 & 4. 100% Source Code. Last revision date Oct 12, 1999. PLEASE FOLLOW THE INSTRUCTIONS PROVIDED IN THE INSTALLATION SECTION! TABLE OF CONTENTS ----------------- Latest Changes Overview History License Agreement Installation Demonstration Programs Source Files Using GIF Images Copyright Notes NEW FOR VERSION 2.75 -------------------- Delphi 5.0 & C++Builder 4.0 Compatibility New components: TRxLoginDialog New properties, events: TFormPlacement.RegistryRoot TFormPlacement.Version TFontComboBox.UseFonts TRxDBGrid.OnTopLeftChanged TRxDBLookupCombo.DisplayValues TStrHolder.Macros, TStrHolder.OnExpandMacros RxSpin.TValueType.vtHex New routines, methods, constants: SaveClipboardToStream, LoadClipboardFromStream (clipmon.pas) AppFileName, AppVerInfo (rxverinf.pas) XorString, XorEncode, XorDecode (strutils.pas) BUG FIXES. Overview -------- RX Library contains a large number of components, objects and routines for Borland Delphi with full source code. This library is compatible with Borland Delphi 1, 2, 3, 4, 5 and Borland C++ Builder 1, 3, 4. This collection includes over 60 native Delphi components. RX Library is a freeware product. Feel free to distribute the library as long as all files are unmodified and kept together. The authors disclaim all warranties as to this software, whether express or implied, including without limitation any implied warranties of merchantability or fitness for a particular purpose. Use under your own responsibility, but comments (even critique) in English (or in Russian) are welcome. 1. Components: TRxDBLookupCombo provides an incremental search through lookup list by directly typing into the combo control while the lookup list is displayed, LookupSource can refer to TTable, TQuery, TRxQuery or TQBEQuery. It even incrementally searches on the query results and much more... TRx
Grid++Report 报表组件适用于VB.NET、C#、VB、VC、Delphi、C++Builder、Foxpro(VFP)、易语言等一切支持 COM 的开发工具。除了提供报表的统计分析、打印、打印预览、数据导出等功能,还提供独有的报表查询显示功能,让报表查询显示、打印、打印预览及数据导出等功能集成一体化实现。轻松实现通用报表、表格报表、动态报表、多层表头、票据与发票套打、交叉表、表表及各种特殊报表等。提供详尽帮助文档与各种编程平台下的丰富例子,安装包括可直接运行例子程序,安装后即刻体验此报表工具。包括简体文版、繁体文版与英文版。经过数年的发展,已经被国内多家有影响力的通用软件厂商采用,其用户遍布各行各业,已经成为用户受众面最广的国产报表开发工具。

Grid++Report 报表组件具有如下特点:
1、适用范围广:VB.NET、C#、VB、VC、Delphi、C++Builder、VFP、易语言等一切支持 COM 的开发工具。
2、功能强大:实现普通格式报表、表格报表、多层表头、票据套打、交叉表等各种报表非常简便;报表完全可编程定义,非常适合开发通用软件的动态报表。
3、独有的报表查询显示功能:除了提供报表的打印、打印预览、数据导出等功能,还提供独有的报表查询显示功能,既提供报表查询与输出的集成一次性实现,又能保证数据的一致性与完整性。
4、特有的分组单元格合并功能,轻松实现常见的国式报表分组在列展现并垂直居
5、提供图表功能,在报表直接实现图表功能。包括:饼图、叠加饼图、柱状图,连线图、散列点图等。
6、报表数据导出格式丰富,格式包括:Excel、PDF、图像、HTML、文本,CSV 等。
7、提供脚本编程功能,直接在报表模板自定义报表行为,采用通用的 VBScript 与 JScript 脚本引擎。
8、支持参数化报表查询SQL语句,轻松实现动态过滤条件筛选报表数据。
9、报表查询显示时提供报表内容文字查找功能。
10、全文界面,针对国报表进行了很多专门实现,如:报表表格线、财务金额线、大写金额、发票打印圆圈画叉图标、负数红字显示、多层表头等。很多在国外报表控件很难实现的功能在本报表控件可以轻易实现。
11、组件提供丰富交互事件,轻松实现报表穿透(透视)查询和报表交互。
12、重新发布简单:只需分发两个 DLL 文件。
13、易学易用:完全可视化设计,完善的复制/剪切/粘贴(Copy/Cut/Paste)和恢复重做(Undo/Redo)功能,专业的拖放操作与即时编辑功能。
14、编写了完整详尽的帮助文档。提供了丰富例程,包括VB.NET、C#、VB、VC、Delphi、C++Builder、VFP、文编程易语言。
15、为 Delphi、C++Builder 编写专门的包装类,象使用 VCL 控件一样使用 Grid++Report。
16、支持所有常规条形码,打印条形码精度高易读取。

Grid++Report 网站:http://www.rubylong.cn
Grid++Report V4.5 下载地址:http://www.rubylong.cn/Download/Grid++Report4.5cn.zip

2,507

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧