Subject Re: [IBO] How To Know, Whether TIB_DSQL has returned any records or not ?
Author Jason Wharton
Yes, IDEAL. The others werer giving general advice without passing on more
specific details. I gave the details.

Your code looks workable. Just keep in mind there are other types of
exceptions that can happen as well. Please don't ask me what all one's cause
I don't know. Just make sure you are able to handle the unknown.

Jason

----- Original Message -----
From: "Kamlesh" <emailkamlesh2000@...>
To: <ibobjects@yahoogroups.com>
Sent: Thursday, July 03, 2003 10:38 AM
Subject: Re: [IBO] How To Know, Whether TIB_DSQL has returned any records or
not ?


> Thank You All
>
>
> > TIB_DSQL is an ideal component for doing this kind of select now that
the
> > bug in InterBase that caused problems doing this is fixed in Firebird.
>
> You mean TIB_DSQL is IDEAL for selecting single record.
> (because previous two replies emphasis on using TIB_Cursor)
>
> i know i should use TIB_Cursor or TIB_Query
> but when i m sure that there is only one record or when i want to select
> only one record then do u think using TIB_DSQL is better
>
> should i use it in following way
>
> With TIB_DSQL.Create Do
> Try
> IB_Connection := MyConnection;
> SQL.Text := < single record select statement>
> Try
> Execute;
> < work with record >
> Except
> On E:EIB_ISCError Do
> Begin
> If E.ERRCODE = 335544374(error code for no record)
> Then
> < do something when no record >
> Else
> Raise;
> End;
> End;
> Finally
> Free;
> End;
>
>
> Regards
> Kamlesh