Board index » delphi » Oracle Stored Procedures - Procedures in Packages

Oracle Stored Procedures - Procedures in Packages

I have no problem using the TStoredProcedure component accessing stored
procedures in Oracle.  However Oracle has an additional feature; namely
packages which group related procedures together in one "Unit".  Delphi
doesn't undertand this, i.e. the list of stored procedures it shows for
the given database are only "true" procedures, not packaged procedures.
If I just go ahead and type theof a packaged proc for the stored
procedure name, then the editor for the parameters shows no fields, and
does not allow me to add fields.  If I try to execute the stored
procedure, I'm stopped before I even get to it because the
StoredProc.Params[x] property always reports an out of bound error;
presumedly because I can't define the parameters.

Does anyone know how to get this to work.  Is the only solution to drop
down to the BDE engine level, or an OCI level package.

Thanks

DML

 

Re:Oracle Stored Procedures - Procedures in Packages


Quote
David Laub <udl...@uxa.ecn.bgu.edu> wrote:
>I have no problem using the TStoredProcedure component accessing stored
>procedures in Oracle.  However Oracle has an additional feature; namely
>packages which group related procedures together in one "Unit".  Delphi
>doesn't undertand this, i.e. the list of stored procedures it shows for
>the given database are only "true" procedures, not packaged procedures.
>If I just go ahead and type theof a packaged proc for the stored
>procedure name, then the editor for the parameters shows no fields, and
>does not allow me to add fields.  If I try to execute the stored
>procedure, I'm stopped before I even get to it because the
>StoredProc.Params[x] property always reports an out of bound error;
>presumedly because I can't define the parameters.
>Does anyone know how to get this to work.  Is the only solution to drop
>down to the BDE engine level, or an OCI level package.
>Thanks
>DML

Hi,
  Although Object Inspector can 't display either pakaged procedures
and their parameters, you can execute them by programming:

i.e.:
    to execute the
       function Foo(P1 number, P2 varchar2) return Number;
   in the package PKG

  with storedProcedure1 do begin
     StoredProcName:='PKG.FOO';        
        { type the pakage name and procedure name in CAPITAL LETTERS}
    Prepare;
    ParamByName('P1').asFloat::=1000;
    ParamByName('P2').asString:='abcd';
    execProc;
    n:=ParamByName('Result').asFloat;
  end;

Hope this Help,

PHAN HUY Khang

Would you apolozige me for my English !!

Cogito ego sum
khap...@mail.planetepc.fr

Other Threads