Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> How to call a stored function from Delphi3

How to call a stored function from Delphi3

From: Magnus S. Petersen <advlaw_at_post.olivant.fo>
Date: 16 May 1998 12:53:53 GMT
Message-ID: <01bd80c1$a579ac60$88ebb6c2@magnuspe>

Using Delphi3 and Personal Oracle
I am regularly using TStoredProc in Delphi to call stored procedures either as stand alone or within packages. It works fine. Recently i tried to call a function within a package, but it gives me problems. The function has as input a couple of formal parameters and its return value is Varchar2.
In the Object Inspector appearently i set the values correct as i in StoredProcName enter PACKAGENAME.FUNCTIONNAME the same way i usually do when working with stored procedures. In the property Params the formal parameters are displaye ok. There is one parameter Result which i assume is the one i shall use and probably is the cause of the malfunctioning. I set the Parameter type of the Parameter Name Result to Result. I call the function like this

     with StoredProc1 do
     begin
          if not prepared then
          prepare;
          ParamByName('PARAMETER1').VALUE  := StrToInt(edit1.text);
          ParamByName('PARAMETER1').VALUE  := StrToInt(edit2.text);
          ExecProc;
          edit3.Text:= IntToStr(ParamByName('Result').value);
     end;

but i cannot get it work.
What am i doing wrong. Please help.

Further Question:
I have a lot of Boolean functions stored within packages, which are used on the server. They work fine with PL/SQL and they RETURN values of BOOLEAN. Can they be called from Delphi and if so how are the parameters to be set.

Regards
Magnus Received on Sat May 16 1998 - 07:53:53 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US