Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Smart Update, How ?
I don't understand ....
you said ... "In my cursor loop, I have an update statement, see below. Now I need to the update only for the field (in that cursor) that has data in it. (which means when is null, that field will not be updated). "
To achieve problem as state in (1) you need to use dynamic SQL because you don't know which columns you will be updating.
For (2)
update my_table
set col_1 = nvl(myrec.col_1, col_1) .....
Here you will check the value in the record (rec_UpdIES) attribute, if it is null, you assign the value of the column to itself, otherwise you update it with record attribute.
Am I making it clear??
Raj
QOTD: Any clod can have facts, but having an opinion is an art!
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Jamadagni, Rajendra INET: Rajendra.Jamadagni_at_espn.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Wed Mar 13 2002 - 09:48:37 CST
- text/plain attachment: ESPN_Disclaimer.txt