Click to See Complete Forum and Search --> : Subselect/update what happens here? Informix


cumquott
10-10-2007, 04:39 PM
Hello all-

I've stared at this for a while, though I'm fairly new to anything stronger the MySQL. This runs, supposedly, on Informix.

I just cannot figure out what this statement does. Looks like it set usr_id to "0000", but then the string concatenations are throwing me off. Anyone? Thanks!

(I tried to format for clarity, but I'm new, so...)

SELECT
"update
xrp
set
usr_id = '0000',
xrp_filename = '" || trim (xrp_filename) || "'
where
xob_id = '" || trim(xob_id) || "' ; "
from
xrp
where
xob_id in (
'VALUE_1', 'VALUE_2', 'VALUE_3'
);

mattyblah
10-10-2007, 05:05 PM
looks like it trims xrp_filename and sets usr_id = '0000' where xob_id = VALUE_1, VALUE_2 OR VALUE_3

cumquott
10-10-2007, 05:13 PM
I that the most complicated way possible to do this?

mattyblah
10-11-2007, 02:41 AM
? i cant understand your comments. this isnt complicated, but i don't know informix, just sql.