The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > HP-UX
Google UNIX.COM


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sqlplus: command not found Tlg13team HP-UX 4 01-24-2008 05:57 PM
Use sqlplus command Nel Shell Programming and Scripting 3 09-11-2006 10:22 PM
check for successfull telnet session sumguy UNIX for Dummies Questions & Answers 0 05-15-2006 10:27 AM
Detecting a successfull FTP connection beilstwh Shell Programming and Scripting 2 09-30-2005 06:53 AM
sqlplus and sh scripts (to_char command)) josecollantes UNIX for Advanced & Expert Users 4 09-06-2001 06:59 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-19-2007
Registered User
 

Join Date: Sep 2007
Posts: 5
How to check sqlplus command is successfull or not in HP UX?

Hi All,

I am not able to check the output of sqlplus command if it fails.

can any body please help me in this regard.
Reply With Quote
Forum Sponsor
  #2  
Old 11-19-2007
Cameron's Avatar
Registered User
 

Join Date: Nov 2001
Location: Brisbane, Australia
Posts: 490
Can you show us the code you are trying to execute and better explain your circumstances ??
Reply With Quote
  #3  
Old 11-19-2007
Registered User
 

Join Date: Sep 2007
Posts: 5
sqlplus -s rcrp/rcrp<<EOF
update PRICE_CLASS_DET set PCD_VALUE=1 where PCD_ID=11313;
commit;
exit;
EOF

if [ $? != 0 ]
then
echo "The Tariff Group Revert Back to Residential Type Customer for Antillia is not completed." | mailx -s "A
NTILLIA BOC ERROR $0" $MAILTO
exit;
fi

The above if condition is not able to catch the error from sqlplus command.
Reply With Quote
  #4  
Old 11-19-2007
Cameron's Avatar
Registered User
 

Join Date: Nov 2001
Location: Brisbane, Australia
Posts: 490
Suggestion is somthing like the following:

. ${HOME}/.profile
......
sqlplus $ASQLUSER @$SQL_DEPOT/sqlplus_filename.sql
......
if [ Check-ERROR-Condition-of-SQL-Output-File ]
then
echo "The Tariff Group Revert Back to Residential Type Customer for Antillia is not completed." | mailx -s "A
NTILLIA BOC ERROR $0" $MAILTO
exit;
fi

= = = = = = = = = = = = = = = = = = = = = =
In
. ${HOME}/.profile

$ASQLUSER=rcrp/rcrp

= = = = = = = = = = = = = = = = = = = = = =
In
$SQL_DEPOT/sqlplus_filename.sql

spool $SQL_DEPOT/LOGS/sqlplus_filename.log
update PRICE_CLASS_DET set PCD_VALUE=1 where PCD_ID=11313;
commit;

= = = = = = = = = = = = = = = = = = = = = =


Hope that the above is able to assist you.
Also makes managing your sql and unix scripts a little easier too.

Cheers,
Cameron.
Reply With Quote
  #5  
Old 11-20-2007
Registered User
 

Join Date: Sep 2007
Posts: 5
Cameron,

That's Brilliant !!!!!!!!

Thanks a lot.

Cheers,
Plaban
Reply With Quote
  #6  
Old 11-20-2007
Cameron's Avatar
Registered User
 

Join Date: Nov 2001
Location: Brisbane, Australia
Posts: 490
No problem - glad I was able to help.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:18 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0