Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Selective updates of an Oracle table

Selective updates of an Oracle table

From: <voichekm_at_yahoo.com>
Date: 7 Dec 2004 22:40:13 -0800
Message-ID: <1102488013.250961.93040@f14g2000cwb.googlegroups.com>


Hi,
I'm using Oracle 8.17 on Unix.
Need to write a ksh script whose input is a few parameters and it updates Oracle table with the parameter values using SQLPLUS. The catch is that some of the parameters might be empty strings (""). It that case, the existent values in the Oracle table should not be updated.
The script should look something like:



#!/bin/ksh
sqlplus -silent "/ as sysdba" << END
UPDATE messengerLog SET stepstatus = IF ($1 = "", stepstatus, '$1') SET failreason = IF ($2 = "", failreason, '$2') ...
commit;
exit;
END

Can you help me to formalize such a script?

Thank you,
Michael Received on Wed Dec 08 2004 - 00:40:13 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US