vc++ 使用oracle ole db访问oracle stored procedure

newgoodboy 2006-02-13 08:01:11
有如下步骤生成的一个stored procedure

1。create table test_table
(ID NUMBER(5),
FIRSTNAME VARCHAR2(10)
);

2。insert into test_table values(1,'hello');

3。CREATE OR REPLACE PACKAGE TEST_PACKAGE
as type test_type is ref cursor return test_table%rowtype;
end test_package;
/


4。 CREATE OR REPLACE PROCEDURE TEST_PROCEDURE (
test_cursor in out test_package.test_type )
as
begin
open test_cursor for
select * from test_table;
end test_procedure;
/
我用以下代码去读取stored procedure 的参数;
schemaRS = adoConnection->OpenSchema (adSchemaProcedureParameters, vtCriteria);
发现返回的schemaRs的size=4(按照道理似乎应该是1)
4个参数的分别是:
name 类型名 类型
test_cursor ref cursor adIUnKnown
"" PL/SQL record adIUnKnown
ID Number adNumeric
FirstName VARCHAR2 adchar

四个参数都是输出的参数(adoParamOutput)。
请问这个结果正确么?
如果正确,再程序中adoCommand->CommandText应该写怎样的sql语句来执行它。
如果不正确,那么是不是vtCriteria的值错误。

望高手解答一下。
万分感谢!


...全文
61 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
蒋晟 2006-02-14
  • 打赏
  • 举报
回复
http://www.oracle.com/technology/sample_code/tech/windows/ole_db/oledb8/index.html
除unidac外我愛用的一套,可存取不同資料庫,取代掉BDE,僅供各位同好試用,喜歡的話請購買支持開發者。 SQLDirect Component Library is a light-weight Borland Database Engine replacement for Borland/CodeGear/Embarcadero Delphi v.5 - 10, 2010, XE-XE10 and C++Builder v.5 - 2010, XE-XE10. It uses the native application programming interfaces to access to the following SQL-servers: IBM DB2 Universal Database Informix Server Interbase/Firebird Server Microsoft SQL Server MySQL Server Oracle Database Server PostgreSQL Server SQLite Database Sybase Adaptive Server Enterprise and Adaptive Server Anywhere Unify (Centura, Gupta) SQLBase Server ODBC datasources OLEDB datasources Using of SQLDirect Component Library gives you the following advantages: connecting to the following SQL servers using 32-bit native application programming interfaces (API): Centura SQLBase Server 6(+), IBM DB2 Universal Database with CAE v5.2, Informix Server 7.2(+), Firebird, Interbase, MySQL 3.23(+), Oracle Server 7.2(+) with SQL*Net 2.2(+), Microsoft SQL Server, PostgreSQL 7.1(+), SQLite, Sybase Adaptive Server Enterprise and Adaptive Server Anywhere (through Open Client, which is supported by Anywhere ver.6 as native interface), ODBC and OLEDB datasources. no distributing, installing and configuring the BDE or ODBC simultaneous access to the supported servers using Delphi 5, 6, 7, 9(2005), 10(2006), 2007, 2009, 2010, XE-XE7 or C++Builder 5, 6, 2006, 2007, 2009, 2010, XE-XE7 (Pro and above) to develop Client/Server applications query with an updatable result set query with macro support table component thread safe BLOB-fields (including LOB and BFILE for Oracle8) stored procedure support (with mutiple result sets for IBM DB2, Microsoft and Sybase SQL Server) bi-directional and unidirectional result sets cached updates record filtering support of data-aware components InfoPower support using images stored by Centura SqlWindows(or Team Developer) in their proprietary format interfaces (public methods and properties) of SQLDirect components are compatible with standard BDE data access components (TSession, TDatabase, TQuery ..).  Thread Safety Note Thread safety is supported by the following software: Oracle SQL*Net 2.3 or above Centura SQLBase Ver. 7 or above IBM DB2 Ver. 5.2 or above Microsoft SQL Server Ver. 6 or above MySQL Sybase ASE and ASA through OpenClient Ver. 11.1 or above  SQLDirect 6.5 was released. Delphi/C++Builder 10.1 Berlin support ftStream-Parameter support support ftWideString support (SQLBase 11.5+) bugfixes
Delphi 7.1 Update Release Notes=======================================================This file contains important supplemental and late-breakinginformation that may not appear in the main productdocumentation, and supersedes information contained in otherdocuments, including previously installed release notes.Borland recommends that you read this file in its entirety.NOTE: If you are updating a localized version of Delphi 7, visit the Borland Registered User web site to obtain a localized readme file that may contain important late- breaking information not included in this readme file.IMPORTANT: Delphi must be closed before installing this update. =====================================================CONTENTS * INSTALLING THIS UPDATE * UPDATING LOCALIZED VERSIONS OF DELPHI 7 * KNOWN ISSUES * ISSUES ADDRESSED BY THIS UPDATE - IDE - CORE DATABASE - DATASNAP - DBGO (ADO COMPONENTS) - dbExpress - dbExpress COMPONENTS AND DB VCL - dbExpress CORE DRIVER AND METADATA - dbExpress VENDOR ISSUES - dbExpress CERTIFICATION - WEB SNAP - ACTIVEX - COMPILER - RTL - VCL - THIRD PARTY - BOLD FOR DELPHI * VERIFYING THAT THE UPDATE WAS SUCCESSFUL * FILES INSTALLED BY THIS UPDATE =======================================================INSTALLING THIS UPDATE* This update can not be applied to Delphi 7 Architect Trial version. * This update can not be removed after it is installed.* You will need the original Delphi 7 installation CD available to install this update.* To install this update from the CD, insert the CD, and launch the d7_ent_upd1.exe file appropriate for your locale.* To install this update from the Web, double-click the self-executing installation file and follow the prompts. * The Delphi 7 documentation PDF files are available on the update CD.========================================================UPDATING LOCALIZED VERSIONS OF DELPHI 7* This update can be applied only to the English version of Delphi 7. There are separate updates for the German, French and Japanese ver

17,078

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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