on 09-19-2012 12:25 PM
Hi:
I need to update a couple of records using an update query based on a select statement. The following examples works perfect:
UPDATE "***"."****"
SET value = 0
WHERE id IN
(SELECT id FROM :A
WHERE value = 1 and (CANT_NEIGHBOURS < 2 or CANT_NEIGHBOURS > 3))
But, I want to do it on the same way using variables:
KILL = SELECT id FROM :A
WHERE value = 1 and (CANT_NEIGHBOURS < 2 or CANT_NEIGHBOURS > 3);
UPDATE "***"."***"
SET value = 0
WHERE id IN KILL;
But crash. The error is not very helpfull. Also I tried to use "WHERE id IN :KILL;" but same result.
All this is under a PROCEDURE sentence.
Ideas???
Thanks in advance!
Hi Leonardo,
Not sure if you already solved this on your own.
Either way: have you tried to put the variable between parenthesis? Something like:
UPDATE "***"."***"
SET value = 0
WHERE id IN (:KILL);
Regards,
Lucas de Oliveira
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.