Subject | Re: [IBO] SQL Error code = -804 |
---|---|
Author | Jason Wharton |
Post date | 2001-08-16T07:17:09Z |
> >First, a quickie: What is the "proper" way to test for "is the resultset
> >empty?"If you are using a buffered query then IsEmpty is the best. This is because
> > RowsSelected, RowsAffected, EOF and BOF, try..except, or ??
>
> Test the .IsEmpty property.
it pertains to the buffer containing any records or is it empty.
If you are using a unidirectional dataset then call the First method (and
not Open) and check for Eof.
> >Second,it
> >
> >This seems to be a simple, direct TIB_DSQL, but on the 2nd execution of
> >(and thereafter), I receive:variables.
> >
> >SQL Error code = -804
> >SQLDA missing or incorrect version, or incorrect number/type of
>statements. Here you are calling Execute on a SELECT statement. You will
> You cannot get a dataset back from a TIB_DSQL - it is for executing
also get this error from calling Open instead of Execute or ExecSQL on a
statement that performs a DSQL operation.
>Actually, the TIB_DSQL component is ideal for doing a singleton fetch which
> If you want to SELECT rows, use TIB_Cursor or TIB_Query.
appears to be what he is doing. Unfortunately, this is the famous bug in
InterBase haunting us yet some more.
The most efficient work around is to use a TIB_Cursor and call the First
method and check for Eof to see if there is a record or not. Then, if you
want to make sure there was only a single record you have to call Next and
check for Eof again. The second fetch will be cheap since IB batches them
together anyway.
HTH,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com