db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Db-derby Wiki] Update of "DerbySQLroutines" by jeanTanderson
Date Fri, 13 Jan 2006 00:53:40 GMT
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:
oops, a "stored" inadvertently made it in (must be that 'other' db experience)

------------------------------------------------------------------------------
  
  == Functions vs. Procedures ==
  
- There is overlap between SQL Functions and Stored Procedures, 
+ There is overlap between SQL Functions and Procedures, 
  but each can also do things the other cannot and the syntax for invoking each is different.
  
  '''SQL functions''' execute as part of a SQL statement and can be used pretty much anywhere
a SQL expression is allowed, such as in the {{{SELECT}}} list or the {{{WHERE}}} clause. SQL
functions can also be invoked in triggers. However, they are read-only -- they cannot modify
data in the database.
@@ -18, +18 @@

  lowercase me!
  }}}
  
- '''Stored procedures''' are invoked with the {{{CALL}}} statement or the {{{CallableStatement}}}
method in a Java client application. Stored procedures support {{{IN}}}, {{{OUT}}}, and {{{INOUT}}}
parameters. If the stored procedure has just {{{IN}}} parameters, you can invoke it anywhere
with the {{{CALL}}} statement, including in ij. If the stored 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. Stored procedures support {{{IN}}}, {{{OUT}}}, and {{{INOUT}}}
parameters. If the stored procedure has just {{{IN}}} parameters, you can invoke it anywhere
with the {{{CALL}}} statement, including in ij. If the stored 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.
  
  Here's an example of invoking built-in stored 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:
  
@@ -63, +63 @@

  
  == Creating Procedures ==
  
- The [http://db.apache.org/derby/docs/dev/ref/rrefcreateprocedurestatement.html Reference
Guide] provides the syntax for creating stored procedures.
+ The [http://db.apache.org/derby/docs/dev/ref/rrefcreateprocedurestatement.html Reference
Guide] provides the syntax for creating procedures.
  
  The [https://svn.apache.org/repos/asf/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/
Derby functional tests] also include procedures.
  

Mime
View raw message