Bourne Shell: Clean Display of stored procedure's output


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Bourne Shell: Clean Display of stored procedure's output
# 8  
Old 04-16-2008
I am actually working on 2 scripts. The process is similar and facing the same problem.

It's funny that one of the script's update section calling the same stored procedure returning the same output parameters did not display any output on the screen. However, the other section including another script always display the "print" output on the screen. Failing to identify the difference, I copied and pasted the working section to the other section and another script. Unfortunately the problem remain. This is really weird. I had to ask a few colleagues to spot the difference but none of them were successful.

I wonder whether there is any special setting/configuration that I may have set without realising that may cause the difference. Any idea?
# 9  
Old 04-16-2008
Try to modify your SQL script :
Code:
$ORACLE_HOME/bin/sqlplus /NOLOG >/dev/null 2>&1c @<<!
SET ECHO     OFF
SET FEEDBACK OFF
SET HEADING  OFF
SET PAGESIZE 0
SET VERIFY   OFF
Connect $DB_USER/$DB_USER_PASSWD@$DB_INSTANCE

Jean-Pierre.
# 10  
Old 04-16-2008
Thanks, again, Jean-Pierre.

I tried those setting, they're not effective either Smilie
# 11  
Old 04-24-2008
I have just found the main cause of the problem. It's due to a simple mistake. The "echo $line" is the one that displays the data unnecessarily. It took me days trying to figure out. Should have spotted this echo earlier.


CUR_MAX=123
# Reading the spool file to get stored procedure's returned values
exec 3<&0
exec 0<$SPOOL_FILE
while read line
do
echo $line
if [ "$line" = 'MAX_OUT' ]; then
read line
read line
CUR_MAX=$line
fi
done
exec 0<&3

echo "Current Max Value is " $CUR_MAX
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh and Oracle stored procedure output in logfile

Friends, I pass some runtime arguments (date, number) through ksh script to Oracle procedure, use input value and pass it on to procedure. Oracle procedure gets input value, run query and logs everything in the logfile. I'm facing with couple of challenges 1. Even though I pass all... (5 Replies)
Discussion started by: homer4all
5 Replies

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

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

4. Shell Programming and Scripting

How to call a stored procedure from shell program?

How to call a stored procedure from shell program (1 Reply)
Discussion started by: noorm
1 Replies

5. Shell Programming and Scripting

input stored procedure to shell program

Hello, I have to call the stored procedure as argument from the unix shell program. Looks like unix doesnt like, can someone comment pls USERID=scott PASSWD=xxxxxx PLSQLCALL=$2 STDT=`sqlplus /nolog <<END >> $LOGFILE conn ${USERID}/${PASSWD}@${ORACLE_SID} whenever sqlerror exit failure... (9 Replies)
Discussion started by: tvanoop
9 Replies

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

7. Shell Programming and Scripting

Call and redirect output of Oracle stored procedure from unix script

Hi, Can you assist me in how to redirect the output of oracle stored procedure from unix script? Something similar to what i did for sybase isql -U$MYDBLOG -D$MYDBNAME -S$MYDBSVR -P$MYDBPWD -o$MYFILE<< %% proc_my_test 8 go %% Thanks in advance - jak (0 Replies)
Discussion started by: jakSun8
0 Replies

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

9. Shell Programming and Scripting

Shell arrays in oracle stored procedure

Is it possible to pass unix shell arrays in Oracle stored procedure? Is yes, how? Thanks (6 Replies)
Discussion started by: superprogrammer
6 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