MoveFirst in Postgres database

I have to migrate several programs that currently use the “openbase” database to postgres. I have a problem with: MoveFirst which is not supported by the postgres plugin on xojo
Anyone have a suggestion? I need a workaround because I have loops inside which I have to perform a MoveFirst.
Thank you very much!!!

I see three options:

You can see if a third party plugin, like MBS, supports this.

You can track and rerun queries to start from the top.

When you first get the data, transfer it to an array of objects that represent each row and work from those. (This is the Orm concept.)

1 Like

just after you sqlselect your query, you’re at the first row.
only movenext is working with all the databases
I doubt other move will ever work any day as it is a loooooong ago request…
if you want to go at first row, then selectsql again.
or like me
make a class that copies a recordset (or rowset) just after making it into memory
then use it the way you want as it has become an array.

with some time, you will get used to only use movenext.
you will have to make more complex sql queries to have all the data you need at first query.
not make a query based on the result of a previous query based … on the first query.

Thanks to both of you for your kind replies.
I’m starting to use postgres now and I don’t have much experience. I’ll follow the advice you gave me such as using an array.
MBS has some other limitations so I prefer the XOJO plugin
Thanks again I get to work …

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.