🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.multi-tier
2 messages
2 total messages Started by Jerri Chiu Mon, 16 Jul 2001 21:47
Getting the returned error string from a PL/SQL procedure
#551
Author: Jerri Chiu
Date: Mon, 16 Jul 2001 21:47
19 lines
1486 bytes
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
Re: Getting the returned error string from a PL/SQL procedure
#552
Author: 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
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads