calling procedure from script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting calling procedure from script
# 1  
Old 05-26-2008
calling procedure from script

Hi All,

My script will call a storedprocedure

#!/bin/bash
#
# Script for ...........
. ../conf/setting.env # Environment file to set the DATABASE

#TODAY=`date '+%Y%m%d_%H'`
#echo TODAY = $TODAY

sqlplus -s $DATABASE <<EOF
spool $TRACKING_LOGDIR/CalcFreqPgsVues_H.log
exec CalcFreqPgsVues_H ('$TODAY');
commit;
exit;
EOF

cat $TRACKING_LOGDIR/CalcFreqPgsVues_H.log >> $TRACKING_LOGDIR/OFR_CalcFreqPgsVues_H.log


My last line in the script (cat command) is not executing....
I need to append my log files in the last line....Is it becos of exit command before that..? any suggestions to overcome this ?? Or Can i append log files inside sqlplus. ?

Thanks and Regards,
# 2  
Old 05-26-2008
Hi, just leave the "exit" out - it should end the session on it's own. Maybe you test it and see if a session/applikation is still there, that is related to your script.

laters
Zaxxon
# 3  
Old 05-26-2008
I tried to remove esit ...
but iam getting following error

PL/SQL procedure successfully completed.


Commit complete.

SP2-0042: unknown command "EOF" - rest of line ignored.
SP2-0042: unknown command "echo hai" - rest of line ignored.
# 4  
Old 05-26-2008
sorry friend...
It s working for me ... thanks for the suggestion
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

Calling same procedure in parallel

hi , I want to call same oracle procedure with different arguments in parallel. how can i do this in shell script. Pls help. (4 Replies)
Discussion started by: Pratiksha Mehra
4 Replies

4. Shell Programming and Scripting

Sub script calling procedure

Hi, I have a doubt regarding how sub scripts will be executed and interested to know internal workflow, For example - My main script is A,it calls a script B then B will call some C....and so on. Then B script run parallel to A or it will wait B to execute then A will continue. ... (1 Reply)
Discussion started by: nag_sathi
1 Replies

5. 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

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 procedure through Unix Shell

how to 1) invoke batch profile to run sqlplus on XXXXX server. 2) execute truncate table xtra.xtra_card_email_request using procedure dbadmin.truncate_table . 3) Check the count before and after the job run. (1 Reply)
Discussion started by: jakred
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 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/showthread.php?t=18264 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... (3 Replies)
Discussion started by: dorisw
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