Page 1 of 1

PostgreSQL and GUID

Posted: Fri 25 Mar 2016 15:45
by Bert1234
The default presentation of uuid differs from the guid used by Microsoft on Windows systems.
PostgreSQL recognizes the Microsoft format with curly braces.

The following works:

Code: Select all

select * from tablename
where fieldname = '{39a46e00-6f7a-49da-9745-782ffca2ee8d}'
Now, when I use a TUniTable component and hook that up to tablename, the following doesn't work:

Code: Select all

UniTable1.Locate('fieldname', '{39a46e00-6f7a-49da-9745-782ffca2ee8d}', []);
The Locate function always returns False.

The following works:

Code: Select all

UniTable1.Locate('fieldname', '39a46e00-6f7a-49da-9745-782ffca2ee8d', []);
The problem is that I don't know (or don't want to know) which database I am connected to. Sometimes I can use SQL which works fine, but sometimes I need the TUniTable approach.

Is there a setting available to let the Locate work with TUniTable?

Regards,
Bert

Re: PostgreSQL and GUID

Posted: Mon 28 Mar 2016 10:40
by AlexP
Hello,

The Locate method searches for data in the DataSet (and not generates a query to the server), and the server returns uuid without braces. Therefore you should manually remove braces when using Locate.