🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #3805

TADOStoredProc with an Oracle PL/SQL Procedure

#3805
From: Olivier Berode
Date: Tue, 25 Jun 2002 11:26
63 lines
2947 bytes
Hello All,

I have just started to try the latest Borland C++ 6 out for
Oracle Database access to stored procedures.

It is possible to call an Oracle stored procedore from TADOStoredProc,
but I am having some dificulties.
Could someone give me some hints ?

I use an ADOConnection to connect to the Oracle Database, because
I want to call the stored procedure called REPAIRS.TEST.
	in package REPAIRS, the next stored proc is defined

	TYPE curs IS REF CURSOR;
	procedure TEST
	(
	 pRetCursor OUT curs
	);

I use the next calls to open the connection and to call the stored
procedure, which work correctly:

	ADOConnection1->Open("test", "test");

	ADOStoredProc1->ProcedureName = "REPAIR.TEST";
	ADOStoredProc1->Prepared = true;
	ADOStoredProc1->ExecProc();

I have not configured any of the Parameters properties of TADOStoreProc,
and the ExecProc() function is called without any problems.

But when I now add an input paramater, before or after the cursor ref,
I always get the same exception:
"EOleException with message ORA-06550 : PLS-00306 Wrong number of
parameters in calling TEST".
	
	procedure TEST
	(
  	 pCounter IN number,
	 pRetCursor OUT curs
	);

I have searched for help in the FAQ papers, Borland help, ... but find
nothing explaining why this is not working.
There should be something wrong with my parameters, but trying different
possibilities did not help me further.

When I want to configure the Parameters propetry, to specify to use
a ftCursor, this is refused because the help says ftCursor can only
be used with TStoredProc instead of TADOStoredProc.

On the other hand, only using the input parameter, leaving our the ref
to the cursor, works fine !

Is there an explication why these 2 could not work together.
Could adding the correct fields in the Parameters properties do the
work?
Is a ref to a cursor returned as a parameter.
Should I use TStoredProc instead of TADOStoredProc ?

Many thanks for any help,
Olivier Berode
Technical Details
Message-ID: <3D185379.5030107@pepbenelux.be>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!supernews.com!newsfeed.news2me.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,3df8b63dab6b15f,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-06-25 04:30:46 PST
Message-ID: <3D185379.5030107@pepbenelux.be>
Date: Tue, 25 Jun 2002 13:26:49 +0200
From: Olivier Berode <olivier.berode@pepbenelux.be>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.9) Gecko/20020311
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.database.ado
Subject: TADOStoredProc with an Oracle PL/SQL Procedure
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 213.193.180.203
X-Trace: dnews 1025004606 213.193.180.203 (25 Jun 2002 04:30:06 -0700)
Lines: 64
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!supernews.com!newsfeed.news2me.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews