01-09-2008 2:32 PM
Hi,
I have a table with couple of GUID fields. Primary key is the main GUID. I have another field by name temp_guid which can have the normal guid values or 00000000000000000000000000000000. I want to write a select statement as follows:
My table name : X
Field required : temp_guid
Select temp_guid FROM X where del_ind = gc_no AND temp_guid is NOT (??)
I dont want to select those rows where temp_guid has the value 00000000000000000000000000000000.
I tried with IS NOT NULL. It doesnt seem to be working. Any help would be appreciated.
thanks,
Ashwin
01-09-2008 2:46 PM
Hi,
well, probably the most correct thing to do, is to declare a constant of the same type as temp_guid, with the value '00000000000000000000000000000000' and use it in the select statement with the NE condition.
..otherwise the condition would depend on the type of temp_guid..
regards,
Stano
01-09-2008 2:46 PM
Hi,
well, probably the most correct thing to do, is to declare a constant of the same type as temp_guid, with the value '00000000000000000000000000000000' and use it in the select statement with the NE condition.
..otherwise the condition would depend on the type of temp_guid..
regards,
Stano
01-09-2008 3:02 PM
Hi Stano,
I was aware of this option. I was thinking whether we have a standard syntax to get the values. I will go ahead with the comparison for values.
thanks,
Ashwin
01-09-2008 2:47 PM
try sth like this:
data h_guid type guid.
clear h_guid.
...
select ....
and temp_guid <> h_guid...
greetings
01-09-2008 2:47 PM
Give this a try:
REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.
RANGES: r_gui FOR x-temp_guid.
CLEAR r_gui.
MOVE '00000000000000000000000000000000' TO r_gui-low.
MOVE 'EQ' TO r_gui-option.
MOVE 'E' TO r_gui-sign. "<=== Note
APPEND r_gui.
SELECT temp_guid
FROM x
WHERE del_ind = gc_no
AND temp_guid IN r_gui.
Rob
01-09-2008 2:50 PM
Hi,
Declare a range.
range r_xx for x_temp_guid.
*population.
r_xx-sign = 'E'. "Exclude
r_xx-option = 'EQ'.
r_xx-low = '00000000000000000000000000000000'.
append r_xx.
*select statement
Select temp_guid FROM X where del_ind = gc_no AND temp_guid in r_xx.
You will get it.
regards,
Subbu