Article View: borland.public.cppbuilder.database.ado
Article #3714Re: TADOStoredProc with an Oracle PL/SQL Procedure
From: Olivier Berode
Date: Wed, 26 Jun 2002 12:58
Date: Wed, 26 Jun 2002 12:58
70 lines
3868 bytes
3868 bytes
Hello Georgi,
I have found the solution, it is very simple.
When you want the TADOStoredProc to have some in parameters and
it should return a cursor as a result, make sure you place the ref to
the cursor at the end of the parameter list.
The cursor is return as a result of the ExecProc () function.
I see now that in my first mail, this is done like that !
So there must have gone something wrong during my tests.
I first had an in parameter, the ref to the cursor and then an other
out parameter : this does not work !!
So the solution is :
place the cursor at the end and it should work.
Example :
PROCEDURE GetRepairs
(
pCust IN VARCHAR2,
pSup IN VARCHAR2,
pOrig IN VARCHAR2,
pIdN IN VARCHAR2,
pType IN VARCHAR2,
pRev IN VARCHAR2,
pSerial IN VARCHAR2,
pDef IN VARCHAR2,
pStatus IN VARCHAR2,
pWar IN VARCHAR2,
pRet IN VARCHAR2,
pFDate IN VARCHAR2,
pTDate IN VARCHAR2,
pRetCursor OUT curs -- Place the ref to the cursor at the end
);
StoredProcRepairs->Active = false;
StoredProcRepairs->Parameters->ParamByName("pCust")->Value = Cust->Text;
StoredProcRepairs->Parameters->ParamByName("pSup")->Value = ESup->Text;
StoredProcRepairs->Parameters->ParamByName("pOrig")->Value = Orig->Text;
StoredProcRepairs->Parameters->ParamByName("pIdN")->Value = EIdN->Text;
StoredProcRepairs->Parameters->ParamByName("pType")->Value = Type->Text;
StoredProcRepairs->Parameters->ParamByName("pRev")->Value = ERev->Text;
StoredProcRepairs->Parameters->ParamByName("pSerial")->Value = Serial->Text;
StoredProcRepairs->Parameters->ParamByName("pDef")->Value = EDef->Text;
StoredProcRepairs->Parameters->ParamByName("pStatus")->Value = Status->Text;
StoredProcRepairs->Parameters->ParamByName("pWar")->Value = EWar->Text;
StoredProcRepairs->Parameters->ParamByName("pRet")->Value = ERet->Text;
StoredProcRepairs->Parameters->ParamByName("pFDate")->Value = EFDate->Text;
StoredProcRepairs->Parameters->ParamByName("pTDate")->Value = ETDate->Text;
StoredProcRepairs->ExecProc();
StoredProcRepairs->Active = true;
Olivier
Georgi Cholakov wrote:
> 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.
Technical Details
Message-ID:
<3D19BA5E.3040008@pepbenelux.be>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!newsfeed.rt.ru!rt.ru!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3D185379.5030107@pepbenelux.be> <3d195e1f_2@dnews>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-26 06:09:28 PST Message-ID: <3D19BA5E.3040008@pepbenelux.be> Date: Wed, 26 Jun 2002 14:58:06 +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: Re: TADOStoredProc with an Oracle PL/SQL Procedure References: <3D185379.5030107@pepbenelux.be> <3d195e1f_2@dnews> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 213.193.180.203 X-Trace: dnews 1025096485 213.193.180.203 (26 Jun 2002 06:01:25 -0700) Lines: 71 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!newsfeed.rt.ru!rt.ru!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnews