After you have executed a DatabaseQuery() is the position in the result set always on the first row or is it necessary to always use
NextDatabaseRow(). For example if I know the result set only has one row can I immediately use functions like GetDatabaseString() etc without using NextDatabaseRow()?
I know I can test this but what I am looking for is understanding of exactly what Purebasic does so I can always count on the behavior as opposed to having stumbled on an undocumented feature that could change in future versions.
Thanks
Simon
Is DatabaseQuery result always on the 1st row?
Is DatabaseQuery result always on the 1st row?
Simon White
dCipher Computing
dCipher Computing
Re: Is DatabaseQuery result always on the 1st row?
You need
Bernd
Code: Select all
If NextDatabaseRow()
Re: Is DatabaseQuery result always on the 1st row?
Yes. After a DataBaseQuery() the pointer of the result row is not defined. so the NextDatabaseRow() command is needed to put it on the "next" element (or to the first row).infratec wrote:You needBerndCode: Select all
If NextDatabaseRow()
Its nearly the same behaviour like lists in PB.
Re: Is DatabaseQuery result always on the 1st row?
if you only have a single row in a query, there's also
as an option
Code: Select all
FirstDatabaseRow(#Database)
there is no sig, only zuul (and the following disclaimer)
WARNING: may be talking out of his hat
WARNING: may be talking out of his hat
Re: Is DatabaseQuery result always on the 1st row?
Not all database drivers support them. '#PB_Database_DynamicCursor'citystate wrote:if you only have a single row in a query, there's alsoas an optionCode: Select all
FirstDatabaseRow(#Database)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive