CallableStatement.setString(String, String);
working??
Exception in thread "main" java.sql.SQLException: Unsupported feature
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBEr
ror.java:689)
at oracle.jdbc.driver.OracleCallableStatement.setString(OracleCallableSt
atement.java:1337)
at Test.main(Test.java:105)
code snippet is....
----------------------------------------
...
String upSql = " call packagename.procname (?)";
CallableStatement cs = conn.prepareCall(upSql);
cs.setString("p_clid_id", "1");
...
cs.execute();
-----------------------------------------
I would really like to be able to reference these input and output
parameters by name instead of by position.
cs.setString(int, String) works fine.
How do I set a variable name as an input parameter, then reference the
parameter by name??
Thanks for any help or direction anyone can provide!
-- Jordan Redner
But in Jordan's case, the error message may be misleading, since
the syntax is wrong -- in the code he has posted.
Jordan, first get the SQL string syntax correct, then see if you
get an error message. I didn't see any mention of the Oracle
version you are using (in your post), so here is a link to the
correct syntax for my version:
http://download-west.oracle.com/docs/cd/A87860_01/doc/java.817/a83724/basic5.htm#1002489
Hope it helps.
Good Luck,
Avi.
Well, is this spec. compliant?
Is there any driver which supports this?
The OP meant "named parameters" which are part of the API but not
implemented in oracles driver.
Christoph Seidel wrote:
My guess is that none do, and for some DBMSes, none ever will.
The driver won't ever know how to convert a procedure parameter
name to an index number into the SQL with question marks. The
only hope this feature has of being implemented is if the native wire-level
client-DBMS protocol has a way of sending values with parameter names.
I don't believe Oracle's does, so this will never be implemented for any
driver to oracle, I think.
Joe Weinstein at BEA
Well, it should be no problem for any driver to find out a name - index
mapping, this is all we need. OLE/DB can do it, jdbc could do it too.