Subject | RE: [IBO] How to know if a query is empty with an IB_Cursor |
---|---|
Author | Jason Wharton |
Post date | 2005-12-29T17:45:47Z |
Normally when AutoFetchAll is true you have appropriate logic hooked to the
AfterFetchRow and AfterFetchEof events.
Jason
AfterFetchRow and AfterFetchEof events.
Jason
> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]On
> Behalf Of Martijn Tonies
> Sent: Thursday, December 29, 2005 5:59 AM
> To: IBObjects@yahoogroups.com
> Subject: Re: [IBO] How to know if a query is empty with an IB_Cursor
>
>
>
>
> > Strange but, when I'm doing :
> >
> > Close ;
> > Prepare ;
> > ParamByName('ID').AsInt64 := id ;
> > First ;
> > a := FieldByName('ID').IsNull ;
> >
> > Then :
> > if the Cursor is in AutoFetchAll=true then a = false
> > if AutoFetchAll is set to false, a = true... with the same data...
> >
> > So it does not work with AutofetchAll = true.
> > I dont understand...
> > Should I set AutoFetchAll to true or false ?
>
> Hmm, although "ID" probably never is NULL, this is not the
> way to check if there's data or not.
>
> An empty resultset does not return NULL for it's columns, it
> doesn't return _anything_ at all.
>
> 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