10-23-2001
Well, I don't know what your data types are but you should
be able to do...
#!/usr/bin/ksh
sqlplus -s scott/tiger@db << EOF > /tmp/result.$$
declare invar number;
declare outvar char(30);
exec myschema.mypkg.myproc(invar, outvar);
dbms_output.putline(outvar);
EOF
read result /tmp/result.$$
echo $result
rm -f /tmp/result.$$
exit 0
...If I thought about for a while, I could come up with
somthing much cleaner but you get the idea.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I am using sqlplus.
I have the stored procedure name.
How can i print the stored procedure content? (2 Replies)
Discussion started by: kamil
2 Replies
2. UNIX for Dummies Questions & Answers
Does anyone know how to call an Oracle stored procedure from a Unix script? (1 Reply)
Discussion started by: ssmiths001
1 Replies
3. UNIX for Advanced & Expert Users
Hi,
Iam calling 3 sql scripts through one shell script 'rmia.sh'.
Till now this was working fine, but last time while calling the SQL scripts,
Oracle was down. But amazingly the exit status was '0' (success)!!!
Below is the shell code:
#!/usr/bin/ksh -x
assign_file asql a.sql 1... (15 Replies)
Discussion started by: ganapati
15 Replies
4. Shell Programming and Scripting
Hi ,
i have created an .sh file that has the following code:
#!/bin/ksh
sqlplus -s p1istuat/p1istuat@CWS_IST6 @Procedure_Execute.sql &
sqlplus -s p1istuat/p1istuat@CWS_IST6 << EOF
exit
EOF
The mentioned Procedure_Execute.sql file inside has the following code:
exec TEST;
... (5 Replies)
Discussion started by: vins_san
5 Replies
5. Shell Programming and Scripting
using the script below I want to pass a parameters thorugh my sql
call(@/unixsxxx/xxxx/helpenv.sql emptab ) as input into an oracle procedure xxxx_package.proc1(%1,emptab); . I tried %1 but it does not work. Any suggestions.
#!bin/ksh
set -x
#
export... (0 Replies)
Discussion started by: TimHortons
0 Replies
6. Shell Programming and Scripting
Hi guys
I am calling one DB2 stored proc through unix. It is giving me below output. I want to capture the value 150 in one UNIX variable in shell script. Please let me know how I can achieve this. Thanks in advance
Value of output parameters
--------------------------
Parameter Name :... (5 Replies)
Discussion started by: vnimavat
5 Replies
7. Shell Programming and Scripting
Hi,
Below is the code to execute the procedure "dbms_job.broken" from the shell script.
on executing manually, it works properly without any error.
but it is not working when scheduled using the cronjob.
#!/usr/bin/bash
user_name="oracdb"
password="ora123"
tns="localdb"... (2 Replies)
Discussion started by: milink
2 Replies
8. Programming
HI All ,
I am new to oracle procedures. Please help me for the approach to satify the requirement.
I need to create procedures. with parameters passed ( say report,type,identities,country )
It should also call sql query within the procedures and passed parameters should be used in where clause... (2 Replies)
Discussion started by: Perlbaby
2 Replies
9. Shell Programming and Scripting
Hi all,
My oracle procedure returns more than one value.
i need to get one value at a time upto ending value ina shell script.
Please help me..... (9 Replies)
Discussion started by: pmreddy
9 Replies
10. Shell Programming and Scripting
My issue pertains to earlier posts like
exit unix script after sqlerror in procedure - dBforums
SQLPLUS Error Capturing | Unix Linux Forums | Shell Programming and Scripting
We are executing PL/SQL blocks from shell scripts using SQLPLUS. The error code has to be captured into a logfile that... (3 Replies)
Discussion started by: jerome_rajan
3 Replies
exit(1) User Commands exit(1)
NAME
exit, return, goto - shell built-in functions to enable the execution of the shell to advance beyond its sequence of steps
SYNOPSIS
sh
exit [n]
return [n]
csh
exit [ ( expr )]
goto label
ksh
*exit [n]
*return [n]
DESCRIPTION
sh
exit will cause the calling shell or shell script to exit with the exit status specified by n. If n is omitted the exit status is that of
the last command executed (an EOF will also cause the shell to exit.)
return causes a function to exit with the return value specified by n. If n is omitted, the return status is that of the last command exe-
cuted.
csh
exit will cause the calling shell or shell script to exit, either with the value of the status variable or with the value specified by the
expression expr.
The goto built-in uses a specified label as a search string amongst commands. The shell rewinds its input as much as possible and searches
for a line of the form label: possibly preceded by space or tab characters. Execution continues after the indicated line. It is an error to
jump to a label that occurs between a while or for built-in command and its corresponding end.
ksh
exit will cause the calling shell or shell script to exit with the exit status specified by n. The value will be the least significant 8
bits of the specified status. If n is omitted then the exit status is that of the last command executed. When exit occurs when executing
a trap, the last command refers to the command that executed before the trap was invoked. An end-of-file will also cause the shell to exit
except for a shell which has the ignoreeof option (See set below) turned on.
return causes a shell function or '.' script to return to the invoking script with the return status specified by n. The value will be the
least significant 8 bits of the specified status. If n is omitted then the return status is that of the last command executed. If return
is invoked while not in a function or a '.' script, then it is the same as an exit.
On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways:
1. Variable assignment lists preceding the command remain in effect when the command completes.
2. I/O redirections are processed after variable assignments.
3. Errors cause a script that contains them to abort.
4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari-
able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not
performed.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
break(1), csh(1), ksh(1), sh(1), attributes(5)
SunOS 5.10 15 Apr 1994 exit(1)