TUniStoredProc with postgreSQL

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Suhaimin
Posts: 79
Joined: Mon 06 May 2013 12:19

Re: TUniStoredProc with postgreSQL

Post by Suhaimin » Mon 13 May 2013 00:51

Thanks AlexP..
UNISTOREDPROC1.STOREDPROCNAME :='GETINVOICENO';
SHOWMESSAGE(UNISTOREDPROC1.PARAMBYNAME('result').ASSTRING);

after i follow your instruction. when i run unistoredproc1.parambyname('result').asstring or unistoredproc1.parambyname('result').asstring , then error occur parameter "result" not found. why this occur? thanks

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TUniStoredProc with postgreSQL

Post by AlexP » Mon 13 May 2013 11:30

Hello,

As I wrote in the last post, OUT parameters (RESULT is an OUT parameter) are initialized on an EXECUTE method call. If you want parameters to be defined before procedure execution, you should run the PREPARE method.

Suhaimin
Posts: 79
Joined: Mon 06 May 2013 12:19

Re: TUniStoredProc with postgreSQL

Post by Suhaimin » Tue 14 May 2013 00:00

hello,

unistoreproc1.execute;
Unistoreproc1.STOREDPROCNAME :='GETINVOICENO';
SHOWMESSAGE(UNISTOREDPROC1.PARAMBYNAME('result').ASSTRING);

i got error parameter "result" not found. i change the code to unistoredproc1.fieldbyname('result').value then error fieldbyname result not found.
why this error occur ? thanks a lot

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TUniStoredProc with postgreSQL

Post by AlexP » Tue 14 May 2013 08:22

Hello,

The Execute method (as well as the Prepare method) should be called after you specify a stored procedure name.

Post Reply