Re: SP call does not work

From: Bjorn Abelli <DoNotSpam.bjorn_abelli_at_hotmail.com>
Date: Mon, 24 May 2004 16:52:39 +0200
Message-ID: <2heghoFc2l00U1_at_uni-berlin.de>


"Virgil Green" wrote...

> Bjorn Abelli wrote:

> > CallableStatement cs =
> > con.prepareCall
> > ("{call schtru.sp_get_all_descr (?, ?, ?, ?)}");

> Are these opening/closing parentheses required by Oracle?

Yes.

AFAIK, that's the standard syntax "inherited" from the similar constructions in ODBC.

> I never use them with SQL Server. A review of the CallableStatement
> interface docs gives no indication that the parentheses are needed.

That's because it's up to the vendor how they have implemented it. If you have an OracleConnection, the CallableStatement is actually an OracleCallableStatement.

If you're familiar with PL/SQL in Oracle, you also know how local variables are used. That syntax is also allowed for the SQL-string as an alternative for the questionmarks.

http://database.sarang.net/database/oracle/jdbc/jdbc_faq.html

// Bjorn A Received on Mon May 24 2004 - 16:52:39 CEST

Original text of this message