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.
Request clarification before answering.
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'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.