Subject | ResulSet not follow |
---|---|
Author | luisfelipehurtado |
Post date | 2003-08-29T20:18:28Z |
Hi everyone,
I'm a developer from Colombia.
I have the following stored procedure...
CREATE PROCEDURE OBTENER_TIPOS_ID
RETURNS (
OUTtid_id SMALLINT,
OUTtid_nombre VARCHAR(50)
)
AS
BEGIN
FOR SELECT *
FROM Ttipos_id
INTO :OUTtid_id, :OUTtid_nombre
DO
SUSPEND;
END;
And I use this code which pretends show the results of the procedure..
cs = con.prepareCall("{call OBTENER_TIPOS_ID}");
rs = cs.executeQuery();
while( rs.next() ) {
System.out.println("Codigo:" + rs.getInt(1));
System.out.println("Nombre:" + rs.getString(2));
}
rs.close();
cs.close();
cs is a CallableStatement and rs is a ResulSet...
The table Ttipos_id is populated with 3 rows.
When I run, only show the first row and exists from the while loop.
What happen?
Sorry about my english...
Thanks.
I'm a developer from Colombia.
I have the following stored procedure...
CREATE PROCEDURE OBTENER_TIPOS_ID
RETURNS (
OUTtid_id SMALLINT,
OUTtid_nombre VARCHAR(50)
)
AS
BEGIN
FOR SELECT *
FROM Ttipos_id
INTO :OUTtid_id, :OUTtid_nombre
DO
SUSPEND;
END;
And I use this code which pretends show the results of the procedure..
cs = con.prepareCall("{call OBTENER_TIPOS_ID}");
rs = cs.executeQuery();
while( rs.next() ) {
System.out.println("Codigo:" + rs.getInt(1));
System.out.println("Nombre:" + rs.getString(2));
}
rs.close();
cs.close();
cs is a CallableStatement and rs is a ResulSet...
The table Ttipos_id is populated with 3 rows.
When I run, only show the first row and exists from the while loop.
What happen?
Sorry about my english...
Thanks.