Fetch won’t work, and how much do you error check?
There is normally no need to test the flag with $fetch. As soon as there is no more data to fetch, $fetch will return kFalse. But normally a SELECT might not return data, so a $fetch with an empty result set is not normally a problem, just a fact of life and there is no need to report this as an error. If you are fetching data in batches, row by row, or batch by batch, and waiting for the fetch to end, then you can use the flag of $fetch to recognize when to stop fetching data. But still this does not represent an error, and is only and information for you as a developer that a state has changed in the database (no more records left to fetch).
Von: omnisdev-en [mailto:email@example.com] Im Auftrag von Das Goravani
Gesendet: Donnerstag, 1. März 2018 22:01
An: OmnisDev List – English <firstname.lastname@example.org>
Betreff: Re: Fetch won’t work, and how much do you error check?
UPDATE: It’s fetching the data but making the #F flag false for some reason. I suppose I have to switch to checking with the status of kFetchError and kFetchFinished etc..
> On Mar 1, 2018, at 12:57 PM, Das Goravani <das@Goravani.com> wrote:
> I have this code and it’s stopping on the fetch, I don’t know why, the record is there to be fetched, it fetched correctly to be put into the invoice…now I’m attempting to change quantity on hand levels in the save process and it won’t fetch, it gives flag false. Do I have something wrong in using #F or any ideas why it won’t fetch…is the flag erroneous sometimes?
> Do iProdRow.$select(con(‘WHERE prod_id=’,iLineItemsList.line_prod_id,’
> FOR UPDATE’)) Returns #F If flag false
> Do method $rollbackokmessagequit (‘Selecting or Locking an Inventory
> Item’) End If Do iProdRow.$fetch() Returns #F If flag false
> Do method $rollbackokmessagequit (‘Fetching an Inventory Item’) End
> If _____________________________________________________________
> Manage your list subscriptions at lists.omnis-dev.com Start a
> new message -> mailto:email@example.com
Manage your list subscriptions at lists.omnis-dev.com Start a new message -> mailto:firstname.lastname@example.org
Manage your list subscriptions at lists.omnis-dev.com
Start a new message -> mailto:email@example.com