Article View: borland.public.cppbuilder.database.ado
Article #3710Re: TADOStoredProc with an Oracle PL/SQL Procedure
From: Georgi Cholakov
Date: Wed, 26 Jun 2002 06:23
Date: Wed, 26 Jun 2002 06:23
80 lines
3870 bytes
3870 bytes
Hi, Olivier
I met the same problem in the same conditions. I had no spare time to search
the reason for this behaviour that's why I made my procedure to work with
needed input parameters without returning a cursor as a result. The result
rows I insert into a temporary table. From my application I start new
transaction, executing the procedure and query after it, to select the data
from the temporary table and at the end the transaction must be finished
(commit or rollback). After finishing the transaction temp. table is
truncated automaticaly.
I know that there must be easier way to do this job, but it obviously
doesn't work.
Georgi Cholakov
"Olivier Berode" <olivier.berode@pepbenelux.be> wrote in message
news:3D185379.5030107@pepbenelux.be...
>
> 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:
<3d195e1f_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!news3.cnt.ru!srcc!newsfeed.gamma.ru!Gamma.RU!news.maxwell.syr.edu!news-out.nuthinbutnews.com!propagator-sterling!news-in.nuthinbutnews.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnewsReferences:
<3D185379.5030107@pepbenelux.be>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,3df8b63dab6b15f X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-06-25 23:35:14 PST From: "Georgi Cholakov" <georgi.cholakov@mail.bg> Newsgroups: borland.public.cppbuilder.database.ado References: <3D185379.5030107@pepbenelux.be> Subject: Re: TADOStoredProc with an Oracle PL/SQL Procedure Date: Wed, 26 Jun 2002 09:23:38 +0300 Lines: 82 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2532.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2532.0000 NNTP-Posting-Host: 80.72.74.98 Message-ID: <3d195e1f_2@dnews> X-Trace: dnews 1025072671 80.72.74.98 (25 Jun 2002 23:24:31 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!news3.cnt.ru!srcc!newsfeed.gamma.ru!Gamma.RU!news.maxwell.syr.edu!news-out.nuthinbutnews.com!propagator-sterling!news-in.nuthinbutnews.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews