Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: What is the precise syntax to call stored procedure?

Re: What is the precise syntax to call stored procedure?

From: Lee Fesperman <firstsql_at_ix.netcom.com>
Date: Sat, 23 Sep 2000 15:14:29 -0700
Message-ID: <39CD2B45.1634@ix.netcom.com>

Joseph Weinstein wrote:
> Lee Fesperman wrote:
> > Interesting.
> >
> > My Java 2 (jdk 1.2.2) javadocs for java.sql.CallableStatement lists the syntax as
> >
> > {[?=] call <procedure-name> [ <arg1>,<arg2>,... ]}
> >
> > No parentheses at all!
>
> You're absolutely right. My bad. Empty parentheses not needed.
> Joe

My apologies, Joe, we are apparently dealing with errors in Sun's documentation. I previously quoted the call escape syntax (stored procedure call) from the javadocs for CallableStatement in JDBC 2.0:

   {[?=] call <procedure-name> [ <arg1>,<arg2>,... ]}

But, that seems to be incorrect. So, I went back to the original source - the ODBC 3.0 spec. Its syntax for the call escape is:

   {[?=]call procedure-name[([parameter][,[parameter]]...)]}

As you see, parentheses are required unless the argument list is empty. This generally agrees with the main documentation for escape syntax in JDBC 2.0 (and 1.0):

    {call procedure_name[(?, ?, ...)]}
    {? = call procedure_name[(?, ?, ...)]}

The javadocs for CallableStatement in both JDBC 2.0 and JDBC 1.0 are incorrect. For JDBC 1.0 CallableStatement, it shows:

{?= call [,, ...]}
{call [,, ...]}

The parentheses are missing from the format. This is wrong. Parentheses are required around the arguments unless there is no argument list.

--
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
================================================================================
* Check out new website - Database Debunking (http://www.firstsql.com/dbdebunk/)
* "The Forum Where Database Matters Are Set Straight"
Received on Sat Sep 23 2000 - 17:14:29 CDT

Original text of this message

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