Visit Our UNIX and Linux User Community


How to check sqlplus command is successfull or not in HP UX?


 
Thread Tools Search this Thread
Operating Systems HP-UX How to check sqlplus command is successfull or not in HP UX?
# 1  
Old 11-20-2007
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.
# 2  
Old 11-20-2007
Can you show us the code you are trying to execute and better explain your circumstances ??
# 3  
Old 11-20-2007
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.
# 4  
Old 11-20-2007
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.
# 5  
Old 11-20-2007
Cameron,

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

Thanks a lot.

Cheers,
Plaban
# 6  
Old 11-20-2007
No problem - glad I was able to help.

Previous Thread | Next Thread
Test Your Knowledge in Computers #714
Difficulty: Medium
Machine learning is a well known method for mitigating the Von Neumann performance bottleneck
True or False?

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Problem on SQLplus command ""bash: sqlplus: command not found""

Hi all, i face an error related to my server ""it's running server"" when i use sqlplus command $ sqlplus bash: sqlplus: command not found the data base is up and running i just need to access the sqlplus to import the dump file as a daily backup. i already check the directory... (4 Replies)
Discussion started by: clerck
4 Replies

2. UNIX for Dummies Questions & Answers

Confirm the execution of Copy command is successfull or not

All, I have to copy huge file from one location to another using python . I want to make sure the execution of Copy command is successful and all the files are copied properly (there has not been any abrupt interruption to the copy process or error like no space available is encountered during... (2 Replies)
Discussion started by: IshuGupta
2 Replies

3. Shell Programming and Scripting

SQLPLUS command with more than 1 select statement

Hi all, I'm using below code processId=`sqlplus -s ${sysuser}/${syspwd} <<CHK_PROCESS whenever sqlerror exit sql.sqlcode; set head off feedback off echo off pages 0 SELECT PROCESS_ID FROM LSHADMIN.DATA_DOMAIN WHERE DOMAIN_NAME = '${tabname}' ... (8 Replies)
Discussion started by: Pratiksha Mehra
8 Replies

4. Shell Programming and Scripting

Sqlplus error - sqlplus -s <login/password@dbname> : No such file or directory

i am using bash shell Whenever i declare an array, and then using sqlplus, i am getting sqlplus error and return code 127. IFS="," declare -a Arr=($Variable1); SQLPLUS=sqlplus -s "${DBUSER}"/"${DBPASS}"@"${DBASE} echo "set head off ; " > ${SQLCMD} echo "set PAGESIZE 0 ;" >> ${SQLCMD}... (6 Replies)
Discussion started by: arghadeep adity
6 Replies

5. Shell Programming and Scripting

Can any one explain this sqlplus command?

Hi , i am new to unix i need a small clarification regarding this sqlplus -s $USER_NAME/$PASSWD@$ORA_SID<< EOF >> SQL_CONN_LOG.log In the above command what is the meaning of <<EOF>> Thanks, krishna. (2 Replies)
Discussion started by: rams_krishna
2 Replies

6. Shell Programming and Scripting

how to use sqlplus command inside for loop

I tried this: for region in 'raj' 'kt' 'kol' 'krl' 'chn' 'dl' 'hr' 'bih' 'ap' do sqlplus -s huw$region/`echo $region`huw#321@huw$region<<! set serveroutput on begin select count(*) from tcd_preferred_cust_201109 end; / exit; done but the error shows like: Syntax error at line 4 :... (1 Reply)
Discussion started by: deepakprasad29@
1 Replies

7. Ubuntu

sqlplus: command not found

I installed Oracle 10.2.1.0 in Ubuntu 10.10..my installation was well,i could even open isqlplus( http://ubuntu.ubuntu-domain:5560/isqlplus/workspace.uix ) and execute some queries..But,back in terminal when i try to login to sqlplus i am getting error (20 Replies)
Discussion started by: sandy0594
20 Replies

8. HP-UX

sqlplus: command not found

hi, i need bash shell script run on the crontab(Unix tru64). i have write my shell. it's using sqlplus command and connect to oracle db. execute cron job when i have error messege: "sqlplus: command not found" have you any suggestion? (4 Replies)
Discussion started by: Tlg13team
4 Replies

9. Shell Programming and Scripting

Use sqlplus command

Can someone tell me how to execute sqlplus command. I`m Executing: sqlplus user/pasw @/report/output/new/PlatformOut_Cdrs.sql the error is: SQL*Plus: Release 9.2.0.5.0 - Production on Wed Aug 9 15:37:44 2006 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. ERROR:... (3 Replies)
Discussion started by: Nel
3 Replies

10. UNIX for Dummies Questions & Answers

check for successfull telnet session

In either case using ksh or tcl, how can I check that I have a successfule telnet session and am being prompted with a tacacs login prompt ? :confused: DOIT () { sleep 2 echo "<tacacs name >" sleep 1 echo "<password>" echo "en" sleep 1 echo "<enable password>" echo "term length 512"... (0 Replies)
Discussion started by: sumguy
0 Replies

Featured Tech Videos