Subject | Firebird 2: does SUSPEND influence ROW_COUNT? |
---|---|
Author | Martijn Tonies |
Post date | 2006-01-19T07:11:42Z |
Hi,
With this procedure:
SET TERM ^^ ;
CREATE PROCEDURE CURSOR_TEST2 returns (
RNAME VarChar(31) )
AS
DECLARE C CURSOR FOR ( SELECT RDB$RELATION_NAME
FROM RDB$RELATIONS );
BEGIN
OPEN C;
FETCH C INTO :RNAME;
WHILE (row_count = 1) DO
BEGIN
suspend;
FETCH C INTO :RNAME;
SUSPEND;
END
CLOSE C;
END
^^
SET TERM ; ^^
And a "select * from CURSOR_TEST2", I only get 2 rows.
Notice the double SUSPEND in the DO BEGIN block.
If I remove the second suspend, it returns all rows.
Got a clue?
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
With this procedure:
SET TERM ^^ ;
CREATE PROCEDURE CURSOR_TEST2 returns (
RNAME VarChar(31) )
AS
DECLARE C CURSOR FOR ( SELECT RDB$RELATION_NAME
FROM RDB$RELATIONS );
BEGIN
OPEN C;
FETCH C INTO :RNAME;
WHILE (row_count = 1) DO
BEGIN
suspend;
FETCH C INTO :RNAME;
SUSPEND;
END
CLOSE C;
END
^^
SET TERM ; ^^
And a "select * from CURSOR_TEST2", I only get 2 rows.
Notice the double SUSPEND in the DO BEGIN block.
If I remove the second suspend, it returns all rows.
Got a clue?
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com