Board index » delphi » ?? Help needed calling stored procedure

?? Help needed calling stored procedure

Hello everyone.

I need some help, I am trying to call an Oracle stored procedure from
Delphi but I am having some trouble.

I have a store procedure "sp" in a package "p". I can invoke it
successfully
in SQL Plus 3.3 using

SQL> execute p.sp('1324');

However, when I try the same thing in Delphi (using the TSQL component)
it
gives me an error.

Invalide use of keyword. Token : p.sp('1324')
Line number: 1.

When I tried to use the TStoredProc component the name of the stored
procedure did not come up in the StoredProcName attribute popup menu.

Any suggestions, ideas would be most welcome.

Please reply by e-mail to
n...@intrahealth.co.nz

Thanks in advance
Nick Ivanov

 

Re:?? Help needed calling stored procedure


Quote
Tomm Carr wrote:

> Nick Ivanov wrote:

> > I have a store procedure "sp" in a package "p". I can invoke it
> > successfully in SQL Plus 3.3 using

> > When I tried to use the TStoredProc component the name of the stored
> > procedure did not come up in the StoredProcName attribute popup menu.

> Use TStoredProc.  The only drawback is that, as you observed, the
> procedures within packages will not show up in the drop-down list.
> However, you can enter the name manually and it will work.

Another solution is to write a normal stored procedure that calls your packaged
procedure :

create procedure p_sp(x in number) as
begin
  p.sp(x);
end;

if the overhead doesn't matter to you.

Marc Billiet

Re:?? Help needed calling stored procedure


Quote
Marc Billiet <Marc.Bill...@alcatel.be> wrote:
>> Use TStoredProc.  The only drawback is that, as you observed, the
>> procedures within packages will not show up in the drop-down list.
>> However, you can enter the name manually and it will work.

>Another solution is to write a normal stored procedure that calls your packaged
>procedure :

Or you can set up a public synonym in Oracle for the procedure in the
package and reference it that way:

create public synonym p_sp for p.sp

HTH
Marc

======================================================================
[ Marc Scheuner, marc.scheu...@berner.ch  CH-3001 BERNE, Switzerland ]
======================================================================

Other Threads