[Opensource] How to call oracle procedure/function

Michael Rimov rimovm at centercomp.com
Wed Aug 28 13:35:43 PDT 2002


At 11:17 AM 8/28/2002 -0700, you wrote:
>Hi all,
>
>I  am trying to  write a class which inherit from DBObject  which will
>use procedure/function in the oracle database,
>would you please show me how (maybe simple example)?

Expresso doesn't directly support embedded SQL procedures.  Now, given 
that, there's a couple of ways to tackle this:

1 - If the procedure represents a calculated field, you can create a 
virtual field that calls the procedure whenever the appropriate getField() 
is called.

2 - If the function should be a method, then add the method to your new 
dbobject.

Either way, you'll want to call DBConnection.getConnection() to get the 
actual database connection so you can execute your calls. [Don't forget to 
manually release the connection or you'll break the connection 
pool].  (Note, this applies to 4.1 only)

HTH!
                                                 -Mike




More information about the Opensource mailing list