Subject | call a Stock Procedure |
---|---|
Author | cmqc |
Post date | 2004-07-08T23:08:37Z |
Hello,
I have a problem, I want to call a stock procedure so I use this
code:
CallableStatement cs = conexion.prepareCall("{call
SHOW_SUPPLIERS}")
ResultSet tablaRes = cs.executeQuery();
but I receive this error message:
GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, char 19
null.
I discovered that this error is caused by the transformation that
java does to the escape syntax. It means at the moment that "{call
SHOW_SUPPLIERS}" is transformed into "EXECUTE PROCEDURE null
(SHOW_SUPPLIERS)". If Firebird uses ISQL the correct syntax must
be "EXECUTE PROCEDURE SHOW_SUPPLIERS" without the null, isn't it?
I tried the code:
CallableStatement cs = conexion.prepareCall("EXECUTE PROCEDURE
SHOW_SUPPLIERS")
ResultSet tablaRes = cs.executeQuery();
but I have the same result. How can I call a Stock Procedure???
Thanks a lot!
Carmen
I have a problem, I want to call a stock procedure so I use this
code:
CallableStatement cs = conexion.prepareCall("{call
SHOW_SUPPLIERS}")
ResultSet tablaRes = cs.executeQuery();
but I receive this error message:
GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, char 19
null.
I discovered that this error is caused by the transformation that
java does to the escape syntax. It means at the moment that "{call
SHOW_SUPPLIERS}" is transformed into "EXECUTE PROCEDURE null
(SHOW_SUPPLIERS)". If Firebird uses ISQL the correct syntax must
be "EXECUTE PROCEDURE SHOW_SUPPLIERS" without the null, isn't it?
I tried the code:
CallableStatement cs = conexion.prepareCall("EXECUTE PROCEDURE
SHOW_SUPPLIERS")
ResultSet tablaRes = cs.executeQuery();
but I have the same result. How can I call a Stock Procedure???
Thanks a lot!
Carmen