cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hello,

I have a UUIDValue column, and I have to execute a query where in the condition there's specified a UUIDValue value. The problem is that I don't know how to specify this value correctly. I tried to use the UUIDValue value like a string, writing it between quotes:

SELECT * FROM myTable WHERE id='ca9ae8ad-2040-4890-bca5-c93b54770516'

with poor results. Then I tried without quotes, without dashes, but nothing!

Have you got any idea?

Thanks in advance,

G.

0 Likes
View Entire Topic
VolkerBarth
Contributor
0 Likes

You could try the following query to find out whether string values are converted correctly to UNIQUEIDENTIFIER values:

select 1 from dummy
where Cast('ca9ae8ad-2040-4890-bca5-c93b54770516' as UNIQUEIDENTIFIER) =
   'ca9ae8ad20404890bca5c93b54770516'

That should yield 1 (and does with v12.0.1.3324). Trying with omitted/added hyphens should work as well:

select 1 from dummy
where Cast('ca9ae8ad20404890bca5c93b54770516' as UNIQUEIDENTIFIER) =
   'ca9ae8ad-2040-4890-bca5-c93b54770516'