Can GetDatabaseString() be called more than once?

Just starting out? Need help? Post your questions and find answers here.
swhite
Enthusiast
Enthusiast
Posts: 794
Joined: Thu May 21, 2009 6:56 pm

Can GetDatabaseString() be called more than once?

Post by swhite »

Hi

In the documentation for the GetDatabaseString() etc. functions states the following:
Note: This function can be called only once for each column. Therefore if this value needs to be used more than once, the data has to be stored in a variable, since all subsequent calls will return the wrong value. This is an ODBC limitation.
Does this restriction only apply to ODBC connections? I am using Postgres which I believe is not using ODBC so does this restriction still apply?

Thanks,
Simon
Simon White
dCipher Computing
User avatar
mk-soft
Always Here
Always Here
Posts: 6226
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Can GetDatabaseString() be called more than once?

Post by mk-soft »

Already tried it yourself ?
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
swhite
Enthusiast
Enthusiast
Posts: 794
Joined: Thu May 21, 2009 6:56 pm

Re: Can GetDatabaseString() be called more than once?

Post by swhite »

Yes I did and it appears to work so I am looking for some official confirmation.

Simon
Simon White
dCipher Computing
Fred
Administrator
Administrator
Posts: 18164
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Can GetDatabaseString() be called more than once?

Post by Fred »

It's ODBC limitation only
swhite
Enthusiast
Enthusiast
Posts: 794
Joined: Thu May 21, 2009 6:56 pm

Re: Can GetDatabaseString() be called more than once?

Post by swhite »

Thank-you for the confirmation.

Simon
Simon White
dCipher Computing
Thorium
Addict
Addict
Posts: 1305
Joined: Sat Aug 15, 2009 6:59 pm

Re: Can GetDatabaseString() be called more than once?

Post by Thorium »

I use Postgres every time i need a DB with PureBasic.
Works very well. Much better than ODBC.

There are a lot of things that work with Postgres which may be not obvious.
For example you can do UPDATE with QueryDatabase (not UpdateDatabase) and use RETURNS to get data about the modified entries. Which is super usefull if there are conditions in the update query and you want to check which condition was met without another query.
Or you simply want to get the primary id, wich you have set to auto increment. Super usefull.
Post Reply