Hello,
I have to call the stored procedure as argument from the unix shell program. Looks like unix doesnt like, can someone comment pls
Below execution is error
I may be missing something, but the above error messages did not come from the script posted in post #1. They also did not come from the Shell itself or SQL Plus - they are custom error messages.
They actually look like the result of some basic vaildation that a parameter was provided to the script. i.e. a piece of shell script which is testing parameter "$#" (the number of parameters supplied). The "Usage" message suggests that the script is expecting one parameter whereas your sample script is taking two parameters.
Your reply is appreciated, i guess i haven't explain the problem clearly. let me brief it again. Below is my complete list of shell program, all it does is execute the sql procedure and creates a log file as the shell program name with date and time + .log in the log file directory. The shell program takes an argument as well.
Now, i need to pass the stored procedure dynamically so that i could reuse my shell program.
Once the shell program executed eg ./test.sh tttt
it creates a log file called test.sh.20100818.19650.log in the log directory.
Please note that, upone passing the second parameter as stored procedure,
there is no log files created with above shell.log and nothing executes...
so giving the second argument 2 does not create the log with same shell program name
and it creates below
idlbatch@vdusappx0201> more security_master_load_stat.0818
Error: Command Line argument is required
Usage: ./test.sh <table name without prefix>
Error: Command Line argument is required
Usage: ./test.sh <table name without prefix>
Error: Command Line argument is required
Usage: ./test.sh <table name without prefix>
Error: Command Line argument is required
Usage: ./test.sh <table name without prefix>
As we guessed the script contains basic validation and checks the number of parameters supplied to the script.
It appears that the script has been modified to introduce a second parameter $2 and the validation has not been changed. It is questionable whether the first parameter $1 has any purpose in the script as posted.
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)
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)
hi all
please tell me how to pass parameters 4m shell script to a DataBase stored procedure.
To be specific i have sybase DB.
i mean i want the syntax of the command..
how to connect to DB, pass user id and password, pass the required parameter to SP..
..
need ur help frnds..
hema (0 Replies)
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)
I have a db2 stored procedure on my database which require 3 parameters, I have the following db2 command in a sql script
CONNECT TO SAMPLE;
CALL BACKUP(INPUT_1, INPUT_2, INPUT3);
Usually, I would just invoke this sql script from my shell script like below
db2 -tf... (1 Reply)
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)