Subject | RES: [Firebird-Java] call a Stock Procedure |
---|---|
Author | Francisco Antonio Vieira Souza |
Post date | 2004-07-09T11:22:02Z |
I suggest:
java.sql.PreparedStatement ps = connection.prepareStatement("SELECT * FROM
SHOW_SUPPLIERS");
ResultSet rs = ps.executeQuery();
RnJhbmNpc2NvIEFudG9uaW8gVmVpcmEgU291emE=
-----Mensagem original-----
De: cmqc [mailto:cmqc@...]
Enviada em: quinta-feira, 8 de julho de 2004 13:32
Para: Firebird-Java@yahoogroups.com
Assunto: [Firebird-Java] call a Stock Procedure
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
Yahoo! Groups Sponsor
ADVERTISEMENT
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/Firebird-Java/
To unsubscribe from this group, send an email to:
Firebird-Java-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.716 / Virus Database: 472 - Release Date: 05/07/2004
java.sql.PreparedStatement ps = connection.prepareStatement("SELECT * FROM
SHOW_SUPPLIERS");
ResultSet rs = ps.executeQuery();
RnJhbmNpc2NvIEFudG9uaW8gVmVpcmEgU291emE=
-----Mensagem original-----
De: cmqc [mailto:cmqc@...]
Enviada em: quinta-feira, 8 de julho de 2004 13:32
Para: Firebird-Java@yahoogroups.com
Assunto: [Firebird-Java] call a Stock Procedure
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
Yahoo! Groups Sponsor
ADVERTISEMENT
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/Firebird-Java/
To unsubscribe from this group, send an email to:
Firebird-Java-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.716 / Virus Database: 472 - Release Date: 05/07/2004