i have a script that performes an update operation. I just wanted to know whether that update statement is successfull or not.
Below the script:
Code:
#!/bin/ksh
. $HOME/conf/systemProperties/EnvSetup.properties
sqlplus -silent sie/da@edn.world <<END
set pagesize 0 feedback off verify off heading off trimspool on echo off
spool /ednadtu3/u01/pipe/naveed/class/Script_Fails.log
UPDATE SIEBEL.S_ASSET_XM SDPX
SET SDPX.ATTRIB_03 = 'Inactive',
SDPX.LAST_UPD_BY = '1-42V',
SDPX.LAST_UPD = SYSDATE,
SDPX.ATTRIB_04 = 'SQQ3'
WHERE SDPX.PAR_ROW_ID IN (select B.PAR_ASSET_ID from SIEBEL.s_asset_rel B
where B.relation_type_cd= 'SDP-METER' ---- and X_rel_status= 'Active'
and B.asset_id
IN (select A.asset_num from SIEBEL.s_asset A where
A.x_electronic_id IN ( '090845086LG')))
AND SDPX.ATTRIB_01 = 'AMR Ready'
AND SDPX.ATTRIB_03 = 'Active';
commit;
spool off
exit;
END
I have use the concept of
spool file but in my script the generated
spool file "Script_Fails.log" is containg null values .Means a 0 byte
spool file is getting created . The query works fine in my database and successfully creating
spool file but using the script it's creating a 0 byte
spool file.please help me in this
Below the
spool file in SQL*Plus:
Quote:
SQL> UPDATE SIEBEL.S_ASSET_XM SDPX
2 SET SDPX.ATTRIB_03 = 'Inactive',
3 SDPX.LAST_UPD_BY = '1-42V',
4 SDPX.LAST_UPD = SYSDATE,
5 SDPX.ATTRIB_04 = 'SQQ3'
6 WHERE SDPX.PAR_ROW_ID IN (select B.PAR_ASSET_ID from SIEBEL.s_asset_rel B
7 where B.relation_type_cd= 'SDP-METER' ---- and X_rel_status= 'Active'
8 and B.asset_id
9 IN (select A.asset_num from SIEBEL.s_asset A where
10 A.x_electronic_id IN ( '090845086LG')))
11 AND SDPX.ATTRIB_01 = 'AMR Ready'
12 AND SDPX.ATTRIB_03 = 'Active';
0 rows updated.
SQL> commit;
Commit complete.
SQL> spool off
|