Xapture Plsql Error from Unix Shell cript


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Xapture Plsql Error from Unix Shell cript
# 1  
Old 04-11-2010
Xapture Plsql Error from Unix Shell cript

Hi Friends,
Need your help . I have a shell script which executes the plsql procedure proc_p1.
I want to capture the error message when the procuder throws some error message.
I codeed in the following way . But it shows Job Success. Kindly anyone give some better idea to over come this
Code:
f_chk_err()
{
  if [[ $1 -ne 0 ]] then
     echo "Job Failed! $2 ... `date`"  >> ${TEMP_CTRL_ERR_FILE}
     
  fi
 if [[ $1 -eq 0 ]] then
     echo "Job Success! $2 ... `date`"  >> ${TEMP_CTRL_ERR_FILE}
     
  fi
}
######
# Main Program
######
sqlplus -s $LOGIN_ID_PW << EOF
exec s1.proc_p1(true);
EOF
f_chk_err $? Exec_aalcgp

Thanks
Ipsita
# 2  
Old 04-11-2010
Code:
sqlplus -s $LOGIN_ID_PW << EOF
whenever SQLERROR exit 1
whenever OSERROR exit 1
exec s1.proc_p1(true);
EOF
f_chk_err $? Exec_aalcgp

Is that what you mean?
# 3  
Old 04-12-2010
Thanks Jim . I am exactly need that . it works.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unix Shell Scripting( Calling from Unix to PLSQL)

Hello Experts, I have the following questions to be discussed here at this esteemed discussion forum. I have two Excel sheets which contain Unix Commands llike creating directory the structure/ftp/Copy/Zip etc to basically create an environment. I need help in understanding some of... (1 Reply)
Discussion started by: faizsaadq
1 Replies

2. Shell Programming and Scripting

calling a plsql procedure through shell script

I have a plsql procedure inside a package which is having one IN parameter .I want to call that procedure through a shell script and that IN parameter is a column of a table in the database. So my requirement is that i need to loop all the entries of that IN parameter from the table through shell... (4 Replies)
Discussion started by: rspnf
4 Replies

3. Shell Programming and Scripting

scope of oracle plsql development /unix shell scripting

I am working in production support in an leading bank and more of my job is more in oracle/plsql. I am learning unix shell scripting and have started development in the same.I would like to know regarding the scope of these two in the industry.Also would like to know about other scripting... (2 Replies)
Discussion started by: jesthomas
2 Replies

4. Shell Programming and Scripting

Execute shell script from plsql trigger

Hi, I have been assigned a job which requires me to send mails from unix(Mailx) upon on certain actions triggered in the database. On insert/update of a certain field into one of the database tables the shell script present in Unix box responsible to send mail though mailx needs to be triggered... (7 Replies)
Discussion started by: hemant.bs11
7 Replies

5. Shell Programming and Scripting

Pass a value from Unix to PLSQL

Hi all, I need to pass a value from Unix to plsql block so that i can use the variable to in where caluse to get the desired output. I tried useing $variable_name, but it doesn't work. Any kind of help is appreciated. Thanks in advance. (3 Replies)
Discussion started by: bankimmehta
3 Replies

6. Programming

Executing shell script from PLSQL

Hi All, I have a requirement to mv a file in unix from plsql procedure. for that i have created a java host procedure, a host_command, given all grants as per ORACLE-BASE - Oracle8i Shell Commands From PL/SQL but i am getting an error ""Process err :/bin/sh: mv Not Found"" kindly let me... (1 Reply)
Discussion started by: aryan_styles
1 Replies

7. Programming

running PLSQL scripts through shell script

I am running the following ealth checks on my server there are two databases in my server . MODEL1 and MODEL2 i connect with the first database as sqlplus model1/password Then i exceute a query select x from table (4 Replies)
Discussion started by: asalman.qazi
4 Replies

8. Shell Programming and Scripting

what is the maximum length of a unix shell variable which can be can passed to plsql

what is the maximum length of a unix shell variable which can be can passed to plsql variable:( (1 Reply)
Discussion started by: alokjyotibal
1 Replies

9. Programming

UNIX Shell Script to Create a Document of a PLSQL code.

Hi All, I am supposed to present the documentation for the PLSQL code (PACKAGES, PROCEDURE, FUNCTIONS) of my application. There are sufficient comments in my code. Has anyone written any Shell Script Utility which can parse the PLSQL code and generate some kind of document ( preferrably HTML not... (1 Reply)
Discussion started by: gauravsachan
1 Replies

10. UNIX for Dummies Questions & Answers

Project with somewhat simple bourne shell cript..

Right now if I have a file that has the following information (with : as the delimiter) name :address :phone number I need to be able to do the following commands: -n search for a name -p search for a phone number -l search for a last name starting with a particular -c find an... (17 Replies)
Discussion started by: Generic
17 Replies
Login or Register to Ask a Question