Subject Problem-DSQL-with-singleton-select
Author Mihai Chezan
Hi,

If I use a TIB_DSQL and an sql that returns an empty result set I get
this error when I execute the dsql:
ISC ERROR CODE:335544374
ISC ERROR MESSAGE:
attempt to fetch past the last record in a record stream

If the select return 1 record then it works.
Is this a bug?

I made a test case:
Problem-DSQL-with-singleton-select.zip
The sql monitor looks like this:

[ 8/17/2004 12:51:43 PM ]
PREPARE STATEMENT
TR_HANDLE = 14577812
STMT_HANDLE = 14577924

select 1 from rdb$database where 1=2

PLAN (RDB$DATABASE NATURAL)

FIELDS = [ Version 1 SQLd 1 SQLn 30
< SQLType: 496 SQLLen: 4 > = <NIL> ]
----*/
/*---
[ 8/17/2004 12:51:43 PM ]
EXECUTE2 DSQL
TR_HANDLE = 14577812
STMT_HANDLE = 14577924
PARAMS = [ ]
FIELDS = [ Version 1 SQLd 1 SQLn 1
< SQLType: 496 SQLLen: 4 > = 0 ]

ERRCODE = 335544374
----*/
/*---
[ 8/17/2004 12:51:43 PM ]
INTERPRET BUFFER =

ERRCODE = 56
----*/
/*---
[ 8/17/2004 12:51:43 PM ]
INTERPRET BUFFER = attempt to fetch past the last record in a record
stream

ERRCODE = -1
----*/