Sv: $select and $fetch

Daniel Sananes daniel.s at
Wed Feb 8 02:14:42 UTC 2023

Hi Mike

You made my night!
Sitting in dark Sweden getting more and more disappointed.
Starting to wonder if $fetch always returns the first record.

Then your solution.

A bit confusing with all ' and ". I probably had them wrong in all my testing.
There ought to be another way so one easily could change the table/schema names in one place and it gets reflected in the statements. 

Many thanks

-----Ursprungligt meddelande-----
Från: omnisdev-en <omnisdev-en-bounces at> För Mike Rowan
Skickat: den 8 februari 2023 01:42
Till: OmnisDev List - English <omnisdev-en at>
Ämne: Re: $select and $fetch

Hi Daniel
I add a query condition within the parentheses after $select like this

Calculate lvQuery as con("WHERE user_id='",iUserList.user_id,"'") Do iRow.$select(lvQuery) Do iRow.$fetch(kfetchall) Returns iFetchStatus

Might be a bit old fashioned, but so am I.

Cheers. Mike

On Wed, Feb 8, 2023 at 5:45 AM Daniel Sananes <daniel.s at>

> Hi everybody
> Having proceeded with Studio I have now got stuck with select and fetch.
> I have a window that reads all users from the Sqlite database.
> This works nice and all users are presented in a list.
> Do iUserList.$definefromsqlclass('user') Returns #F.
> Do
> iUserList.$sessionobject.$assign($root.$sessions.[iSession].$sessionob
> ject)
> Returns #F.
> Do iUserList.$select() Returns #F.
> Do iUserList.$fetch(kFetchAll) Returns lFetchStatus.
> When clicking on list iUserList the user_ID is retrieved.
> Then I do as below to get user into a row. I always get the first 
> user, that is the user with id 1.
> How do I construct the $select so it selects record with the test-ID 68?
> Or maybe the $fetch is wrong?
> Calculate lID as 68.
> Do iRow.$definefromsqlclass('user') Returns #F.
> Do 
> iRow.$sessionobject.$assign($root.$sessions.[iSession].$sessionobject)
> Returns #F.
> Do iRow.$select([iUserList.user_id=lID]) Returns #F.
> Do iRow.$fetch() Returns iFetchStatus.
> regards
> /Daniel
> 0736 704070
> _____________________________________________________________
> Manage your list subscriptions at Start a 
> new message -> mailto:omnisdev-en at
Manage your list subscriptions at Start a new message -> mailto:omnisdev-en at
VARNING: Det här e-postmeddelandet kommer från en extern avsändare. KLICKA INTE på länkar eller bilagor om du inte känner igen avsändaren och vet att innehållet är säkert.

More information about the omnisdev-en mailing list