Subject | Re: [Firebird-Java] CallableStatement returning a ResultSet! |
---|---|
Author | Roman Rokytskyy |
Post date | 2004-12-03T20:06:18Z |
> CallableStatement cs = conn.prepareCall("EXECUTE PROCEDUREIf your procedure is selectable, you have to use SELECT * FROM procedure.
> TEST_RS_RETURN()");
> ResultSet rsc = cs.executeQuery();
> while(rsc.next()){
> System.err.println(rsc.getString(1));
> }
>
> The procedure must return a result set containing 3 records. But the
> returning result set containts only one record. Can you please tell
> me if is something wrong with my code? or what is the reason the
> ResultSet object containts only one record.
EXECUTE PROCEDURE will select only first row. That's Firebird specifics. You
cannot use selectable procedures with EXECUTE PROCEDURE statements.
In your case you should use:
PreparedStatement stmt = con.prepareStatement(
"SELECT * FROM TEST_RS_RETURN()");
ResultSet rs = stmt.executeQuery();
> CallableStatement cs = conn.prepareCall("?=EXECUTE PROCEDUREThis is completely incorrect. Please either use Firebird syntax or escaped
> TEST_RS_RETURN()");
syntax.
> cs.registerOutParameter(1, Types.OTHER);JayBird does not know Types.OTHER.
Roman