Select with GUID won't work

Report SqlBase bugs and possible workarounds.
ZERO_JB
Germany
Posts: 32
Joined: 05 Sep 2018, 11:44
Location: Pfinztal

Select with GUID won't work

Post by ZERO_JB » 21 Jan 2015, 15:05

Hello,

I`ve got a Problem executing the following select-statement from java using the lib "SQLBaseJDBC.jar":
SELECT * WHERE GUID = '{CB9D5759-0C2A-45EB-A8CF-0F6EB7839C3C}'

The same select works when I uses SQLTalk.

Executing other select statement from java works correctly, so the db-connection, user and pass are ok.
So, how is the correct syntax for using GUID in the where condition over java ("SQLBaseJDBC.jar")?

best regards

Bertram

Mike Vandine

Re: Select with GUID won't work

Post by Mike Vandine » 22 Jan 2015, 06:51

Hi Bertram,

Can you post a complete sample that shows this problem?

Also check your statement:
SELECT * WHERE GUID = '{CB9D5759-0C2A-45EB-A8CF-0F6EB7839C3C}'

select * FROM XXXXX where guid...

Best regards,

ZERO_JB
Germany
Posts: 32
Joined: 05 Sep 2018, 11:44
Location: Pfinztal

Re: Select with GUID won't work

Post by ZERO_JB » 22 Jan 2015, 07:38

Hi mvandine,

sorry I trimmed the SQL to much for this Forum. Now with FROM-clause ... :
SELECT * FROM VWMAPPOLTER WHERE GUID = '{9BDBCFF6-3FE3-45BE-9DF8-F8211D1ED913}'

Problem-Details:
1. SQLTalk: When I execute the SQL with SQLTalk I geht a result with one element, erverthing's fine.

2. Java:
- When I execute the same SQL from java using the lib "SQLBaseJDBC.jar" I got an empty result.
- I tried changing the SQL, GUID with sigle quote and without, but always I got an empty result
- If I change the where-clause to an other Attribute, for Example GEONAME (String-Type) I got a result
- So I don't know how to write the SQL-Statement using the GUID in where-clause to get the one expected result

Can it help unsing PreparedStatement instead of Statement? What type has to be used für the GUID-Attribute (maybe String-type won't work)?

Best regards

Mike Vandine

Re: Select with GUID won't work

Post by Mike Vandine » 22 Jan 2015, 07:45

Can you give me table build and insert statements plus your current java file that does the select and statements that do selects that work and don't work and I will get this looked into.

Cheers!

Return to “Bug Reports”

Who is online

Users browsing this forum: [Ccbot] and 0 guests