GUID returns only odd rows

Discussion forum about all things SqlBase.
mmi_rqm

GUID returns only odd rows

Post by mmi_rqm » 20 Apr 2015, 15:29

GUID returns only odd rows

Postby mmi_rqm » Thu Apr 16, 2015 3:00 pm
Hello,

I've a problem with GUID columns in SELECT statement. Statement like this:

SELECT gid
INTO :sGid
FROM some_table

will return only odd rows from database on SalTblPopulate or on SqlFetchNext. That means if in DB I have:

gid
---------------
42CA7B43-4453-4850-BDB3-D8A06B8D9C80
201C382C-B855-473B-99C5-CC867425D19E
73FC2D7D-8D8D-4DF8-BB8A-30AC7B1B8B9D

result with SalTblPopulate or SqlFetchNext would be:
42CA7B43-4453-4850-BDB3-D8A06B8D9C80
73FC2D7D-8D8D-4DF8-BB8A-30AC7B1B8B9D

I'm working on Team Developer 5.2-SP3, on virtual machine with windows XP, but application acts the same on windows 7 and windows 8.
Databases are on SQL Server 2012 and SQL Server 2008 R2 and both have problem with GUID (uniqueidentifier).
On Oracle there is no problem since there GUID is char(36).

Here is a test case. Just execute query.sql on your DB and insert appropriate parameters for DB connection in Go() function.

Have anyone come across to this problem?
Thanks.
You do not have the required permissions to view the files attached to this post.

ROUX Ch.

Re: GUID returns only odd rows

Post by ROUX Ch. » 21 Apr 2015, 08:29

hello,

The latest version is 5.2 sp5. It would start with patching your version 5.2 sp3.

However try this :

Set SqlDatabase = "regina"
Set SqlUser = "sysadm"
Set SqlPassword = "sysadm"
Call SqlConnect( hSql )
Call SalTblPopulate( tbl1, hSql, "SELECT gid FROM some_table", TBL_FillAll )
Call SqlDisconnect( hSql )


Best regards,

ROUX Ch.

mmi_rqm

Re: GUID returns only odd rows

Post by mmi_rqm » 21 Apr 2015, 09:15

Issue is resolved.
Problem was that in sql.ini, in [ODBCRTR] section fetchrow was 20.
When there is no fetchrow in [ODBCRTR], or when fetchrow = 1, problem with load of GUID values will not appear.

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests