🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.multi-tier
Article #552

Re: Getting the returned error string from a PL/SQL procedure

#552
From: Jerri Chiu
Date: Wed, 18 Jul 2001 01:40
48 lines
2637 bytes
Hi,

never mind my first question, I guess I have to use the TStoredProc control:
        StoredProcSP->DatabaseName = "dbXX";
        StoredProcSP->ParamsByName("ParamA")->AsString = "a";
        StoredProcSP->ParamsByName("ReturnCode")->AsString = "";
        StoredProcSP->ParamsByName("ErrorString")->AsString = "";
        StoredProcSP->StoredProcName = "proc_x";
        StoredProcSP->Prepare();
        StoredProcSP->ExecProc();
        strReturnCode = StoredProcSP->ParamByName("ReturnCode")->AsString;
        strErrorStr = StoredProcSP->ParamByName("ErrorString")->AsString;

where i use specified all my parameters, such as the name, type, etc.

does this give me the ReturnedCode and ErrorString?  it keeps giving me a
'Syntax error or access violation' error when i try to execute the procedure
at ExecProc().  another questions is, since i am already logged onto the
database, is there a way to make that dialog box (asking for username,
password at Prepare()) disappear?

Thanks much
Jerri Chiu


"Jerri Chiu" <jeje@home.com> wrote in message news:3b536117$1_2@dnews...
> Hi,
>
> I want to execute a PL/SQL procedure using a TDataSource + TQuery like
this:
> strSQL.sprintf("CALL proc_x"
>                 "('%s', %s, %s)",            <=??
>                 strParam.c_str(),
>                 strReturnCode.c_str(),    <=??
>                 strErrorString.c_str());    <=??
>
> qUpdate->SQL->SetText(strSQL.c_str());
> qUpdate->ExecSQL();
>
> where proc_x returns a ReturnCode and an ErrorString, I would like to use
> strReturnCode and strErrorString to store these returned values, how do I
> rephrase my sprintf statement?  in other words, how should the proc_x be
> called?
>
> Thanks much
> Jerri Chiu
>
>
Technical Details
Message-ID: <3b54e93b$1_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews
References: <3b536117$1_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fcd2b,5dabb98860a38d57
X-Google-Attributes: gidfcd2b,public
X-Google-ArrivalTime: 2001-07-17 18:44:34 PST
From: "Jerri Chiu" <jeje@home.com>
Newsgroups: borland.public.cppbuilder.database.multi-tier
References: <3b536117$1_2@dnews>
Subject: Re: Getting the returned error string from a PL/SQL procedure
Date: Tue, 17 Jul 2001 18:40:51 -0700
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
NNTP-Posting-Host: 130.110.218.115
Message-ID: <3b54e93b$1_1@dnews>
X-Trace: dnews 995420475 130.110.218.115 (17 Jul 2001 18:41:15 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews