nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

to find whether update is successfull or not using Ksh Script

This is a discussion on to find whether update is successfull or not using Ksh Script within the Shell scripting forums, part of the Development/Scripting category; i have a script that performes an update operation. I just wanted to know whether that update statement is successfull ...

Register free or login to your existing account and remove all advertisements.


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Linux answers from nixCraft.


Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-06-2009, 03:02 PM
Junior Member
User
 
Join Date: Dec 2008
OS: Debian
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
ali560045 is on a distinguished road
Default to find whether update is successfull or not using Ksh Script

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

Last edited by ali560045; 01-06-2009 at 03:06 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
uanble to do software update manoharp2008 Linux software 0 08-02-2008 01:36 PM
driver update pansarevai Linux hardware 2 07-16-2008 02:41 PM
Update Password File amsreeku Linux software 2 03-02-2008 07:02 PM
writing a shell script to find out my shell name jaymob123 Shell scripting 1 10-08-2007 12:36 AM
How can I Update the XML Tag Values using Shell Script Mithun_Kamath Shell scripting 1 01-25-2007 12:29 AM


All times are GMT +5.5. The time now is 01:43 AM.


Powered by vBulletin® Version 3.8.4 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2009 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38