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 -> Invoking stored functions from OCI8 ?

Invoking stored functions from OCI8 ?

From: Mart Käsper <mart_at_netsoftlund.se>
Date: Tue, 28 Sep 1999 10:29:32 +0200
Message-ID: <37F07C6C.5DD36C2C@netsoftlund.se>

Hi,

the way of invoking a stored procedure from OCI8 is to insert it into a PL/SQL block as follows :

   "BEGIN myStoredProcedure( :arg1, :arg2, :arg3); END;"

Now - suppose I have a stored function that takes input arguments and returns a single value ... how should the string above be formatted then ?

I tried using =

   "BEGIN :ret = myStoredFunction( :arg1, :arg2, :arg3); END;"

but I couldn't bind to the returned value. In some example I saw the convention :

   "SELECT myStoredFunction( :arg1, :arg2) FROM myTable"

but is that true ? Why should you have to cencern yourself of the table that implicitly gets invoked by the stored function anyway ?

Thanks in advance :-)




   Mart Käsper                 E-mail            : mart_at_netsoftlund.se
   Netsoft Lund AB
   Bredgatan 15                Tel (in place)    : +46 46  19 04 95
   S-222 21 Lund, Sweden       Tel (on the road) : +46 70 319 04 95

==========================
==========================
====================

#include <std.disclaimer>


   I like Techno - unplugged Received on Tue Sep 28 1999 - 03:29:32 CDT

Original text of this message

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