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 -> Re: Calling a function in Oracle from Delphi

Re: Calling a function in Oracle from Delphi

From: Christian Kaas <c.kaas_at_odn.de>
Date: 1997/09/04
Message-ID: <340ef0b6.20619989@news.nuernberg.odn.de>#1/1

i thibk this would be an ideal thread for a delphi newsgroup but here is the answer:
create a tdatabase component on a for,/datamodule in delphi connect the tdatabase to your oracle db. drop a TStorepeocdure onto the form/datamod. set the databasename property of the tstoredproc to your Tdatbase's select your previously created oracle funktion or procedure from the list in the object inspector.
check the parameters and types.
in delphi you execute the procedure with the follwing code lines: begin
...
with yourTstoredproc do
begin
  if not(PrepareD) then
    Prepare;
  // set the params
  parambyname('Param1').AsString := 'abc';   ExecProc;
  Close;
  Unprepare;
end;

here is the listing for your oracle procedure: create or replace procedure delphidemo (echostring in out varchar2) is begin

   echostring := 'the echo is ' || echostring; end;
/

If you need more input email me.

On 27 Aug 1997 13:45:29 GMT, "Magnus S. Petersen" <advlaw_at_post.olivant.fo> wrote:

>Delphi uses the TStoredProcedure, which enables one to call a procedure in
>Oracle.
>Oracle also operates with the possibility to write Functions.
>How can one call such functions from Delphi. ?
>Regards
>Magnus
>

Christian Kaas
Client/Server development and consulting Fax. 49-9129-5518
Phone 49-9129-5508 Received on Thu Sep 04 1997 - 00:00:00 CDT

Original text of this message

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