Calling stored procedure from shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Calling stored procedure from shell script
# 1  
Old 06-11-2007
Calling stored procedure from shell script

HI,

I have a similar problem to thread 18264, only I couldn't get it to work.

https://www.unix.com/shell-programming-and-scripting/18264-calling-stored-procedure-shell-script.html

I have a stored procedure which is called by a shell script program. When I run the stored procedure alone or through the shell script, it works fine with output text file.

However, if the shell script is executed by a scheduled job (a remote user), the stored procedure will never get executed. The DBA checks permissions on all the related tables and permissions are properly given.

Can anyone tell me why the stored procedure is not working when called by a scheduled job? How to fix this problem?

Thanks in advance for your help!

Doris
# 2  
Old 06-11-2007
Typically these problems are cause by the environment being very minimal in cron jobs.

For example if you were using oracle, failing to initialize the environment variables used by Oracle such as ORACLE_HOME, ORACLE_SID, PATH and LD_LIBRARY_PATH will cause database code to fail.
# 3  
Old 06-11-2007
Look in /var/mail under the owner of the cron job.
/var/mail/<owner>
It may be, as noted, an environmental setting which
could be a path issue. Normally you'll get an email
from cron if syslog.conf is configured to send users
messages about cron jobs. Typically if it's a path issue
you will see an error indicating a script or some command
was not found when you check the context of the email.
# 4  
Old 06-12-2007
Thanks to Porter and bdsffl. I showed your suggestions to our DBA and unix admin, and finally got the environment variable resolved. A simple fix by our UA:

1) open up the .profile file
2) copy the line with environment setting (in our case: all_paths_list) to shell script which calls the stored procedure.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. How to Post in the The UNIX and Linux Forums

Calling a Sybase Stored procedure from a UNIX Script

Hi, I am new to shell scripting and Sybase database i need a help that i try to execute a SYBASE stored procedure from a Unix shell script and wanna write the output of the SP into a Text File.somehow i try to find a solution but whwn i try to run the script i am not getting the output file with... (1 Reply)
Discussion started by: Arun619
1 Replies

2. Shell Programming and Scripting

Calling Oracle stored procedure from ksh script

Friends, I'm newbie with ksh so wanting some help.... 1. I'm trying to call oracle stored procedure from ksh script by taking variable value from runtime, feed into script and execute procedure. 2. Put name1 and name2 value from script run replacing $3 & $4 I'm trying to put name1 in... (4 Replies)
Discussion started by: homer4all
4 Replies

3. Shell Programming and Scripting

Run stored procedure from shell script

Hello all, I am trying to run stored procrdure from shell script which takes one argument. And also I want to verify in the script whether the script executed successfully. However the Stored procedure is not running from shell script. Manually if I run it update the data in the table. Can... (29 Replies)
Discussion started by: PriyaSri
29 Replies

4. Shell Programming and Scripting

How to get OUT parameter of a stored procedure in shell script?

I am invoking a SQL script from shell script. This SQL script will invoke a stored procedure(which has the OUT parameter). I want to have the OUT parameter in the shell script as a variable. Is this possible? (6 Replies)
Discussion started by: vel4ever
6 Replies

5. Shell Programming and Scripting

How to execute the stored procedure from shell script

How to execute the stored procedure from shell script and is there any possibility to print the dbms output in a log file. (2 Replies)
Discussion started by: dineshmurs
2 Replies

6. UNIX for Dummies Questions & Answers

Calling stored procedure from unix

Hi, My stored procedure returns a value. How to retrieve the value and display in unix. Stored procedure CREATE OR REPLACE PROCEDURE gohan(num INT) IS BEGIN DBMS_OUTPUT.PUT_LINE('My lucky number is ' || num); END; Unix Scripting i used sqlplus -s... (7 Replies)
Discussion started by: gohan3376
7 Replies

7. Shell Programming and Scripting

calling a PL/SQL stored procedure from KSH

Hi I have a stored procedure which should be called from KSH. Could ayone please help me with this. Thanks (1 Reply)
Discussion started by: BlAhEr
1 Replies

8. Shell Programming and Scripting

Calling an Oracle Stored Procedure from Unix shell script

hai, can anybody say how to call or to execute an oracle stored procedure in oracle from unix... thanks in advance.... for ur reply.... by, leo (2 Replies)
Discussion started by: Leojhose
2 Replies

9. Shell Programming and Scripting

Calling MYSQL Stored Procedure?

Hi, Can anyone help me with the correct syntax to call a MYSQL stored procedure from a shell script. I have tried the following, (no input params): /usr/bin/mysql -uadmin -ppassword call TL_CLENSEDATA(); resulting in error: /home/hosting/data/scripts/dbclense.sh: line 12: syntax error... (3 Replies)
Discussion started by: kshelluser
3 Replies

10. Shell Programming and Scripting

calling stored procedure from shell script.

Hi All, This is a very starnge problem I am having. I have a shell script that calls a stored procedure. Here's my code in shell script: sqlplus "userid/pwd" @file.sql and file.sql has the following statement: exec my_storedProc; Now, when I execute my shell script, nothing... (2 Replies)
Discussion started by: priyamurthy2005
2 Replies
Login or Register to Ask a Question