You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by Apache Wiki <wi...@apache.org> on 2006/09/21 18:01:22 UTC

[Db-derby Wiki] Update of "DerbySQLroutines" by jeanTanderson

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification.

The following page has been changed by jeanTanderson:
http://wiki.apache.org/db-derby/DerbySQLroutines

The comment on the change is:
added note that 10.2 supports invoking java procedures in triggers

------------------------------------------------------------------------------
  
  Another example is using a function for LanguageBasedOrdering.
  
- '''Procedures''' are invoked with the {{{CALL}}} statement or the {{{CallableStatement}}} method in a Java client application.  Procedures support {{{IN}}}, {{{OUT}}}, and {{{INOUT}}} parameters. If the procedure has just {{{IN}}} parameters, you can invoke it anywhere with the {{{CALL}}} statement, including in ij. If the procedure has {{{OUT}}} or {{{INOUT}}} parameters, it can't be invoked from ij, it must be invoked from a client application using the {{{CallableStatement}}} method.
+ '''Procedures''' are invoked with the {{{CALL}}} statement or the {{{CallableStatement}}} method in a Java client application.  Procedures support {{{IN}}}, {{{OUT}}}, and {{{INOUT}}} parameters. If the procedure has just {{{IN}}} parameters, you can invoke it anywhere with the {{{CALL}}} statement, including in ij. If the procedure has {{{OUT}}} or {{{INOUT}}} parameters, it can't be invoked from ij, it must be invoked from a client application using the {{{CallableStatement}}} method. Starting in [http://issues.apache.org/jira/browse/DERBY-551 Derby 10.2], a java procedure can also be invoked in a trigger.
  
  Here's an example of invoking built-in procedures using {{{ij}}}. The first loads my 'myStuff.jar' jar file into the database and the second sets my database class path to include that jar:
  
@@ -40, +40 @@

  You can't invoke a sql function using {{{CALL}}} -- and you can't invoke a procedure using {{{VALUES}}}. That's just one of the differences between them. More comparisons are summarized in the table below:
  
  ||'''Feature'''||'''Procedure'''||'''Function'''||
- ||Execute in a trigger||no||yes||
+ ||Execute in a trigger||no ([http://issues.apache.org/jira/browse/DERBY-551 yes in 10.2])||yes||
  ||Return result set(s)||yes||no||
  ||Process OUT / INOUT Params||yes||no||
  ||Execute SQL select||yes||yes||