06-03-2005
Execute an Oracle stored procedure from a shell scrip
Here is a snippet of my code:
if [ $FileName != $File ]
then
echo "\n Deleting all reports older than 24 hours. \n" >> $logfile
ls -l $FileName >> $logfile
rm -f $FileName
$ORACLE_HOME/bin/sqlplus -s <<EOF > oracle.log
$DB_id/$DB_pswd@$DB_server
execute RemoveRptFiles($FileName)
EOF
fi
I am getting a syntax error when I add the Oracle connection code. Does anybody kknow what I am doing wrong?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Is it possible to pass unix shell arrays in Oracle stored procedure?
Is yes, how?
Thanks (6 Replies)
Discussion started by: superprogrammer
6 Replies
2. Shell Programming and Scripting
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
3. 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
4. Shell Programming and Scripting
Here's a shell script snippet.....
cd $ORACLE_HOME/bin
Retval=`sqlplus -s <<eof
$TPDB_USER/april@$TPD_DBCONN
whenever SQLERROR exit 2 rollback
whenever OSERROR exit 3 rollback
set serveroutput on
set pages 999
var status_desc char(200)
var status_code... (1 Reply)
Discussion started by: hidnana
1 Replies
5. Shell Programming and Scripting
Hi
i am calling a stored procedure from unix shell like this call
test_proc('0002','20100218');
the stored procedure was giving output
like this dbms_output.put_line(' processed earlier');
i want to see the output in the unix shell where i called.
Thanks
barani (6 Replies)
Discussion started by: barani75
6 Replies
6. Shell Programming and Scripting
Hi
i want to call a oracle stored procedure from unix (using bash shell).
consider this is my oracle stored procedure with parameter
create procedure testproc(name IN varchar, age IN Number, id OUT Number )
AS
begin
id=1;
dbms_output.put.line('successfull validation')
end;... (6 Replies)
Discussion started by: barani75
6 Replies
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
Hi Gurus,
Want to execute a shell script from a oracle procedure and get the status of the same, any assistance in this regard will be appreciated.
proc_data.sh is script name which I want to execute from oracle procedure
It should work something like below
procedure test
begin... (1 Reply)
Discussion started by: palanisvr
1 Replies
9. Shell Programming and Scripting
Hi,
I am very new to this environment - I hope this is the right platform to discuss my issue:
I created a CRON job to run a Stored Procedure from our database - Sybase.
Within the Stored Procedure there is a TRUNCATE table and CREATE table function.
the CRON job fails to run with... (2 Replies)
Discussion started by: pizzazzz
2 Replies
10. UNIX for Beginners Questions & Answers
Here is the shell script which need to trigger a stored procedure and when the record count is 0 then it should capture in the log that 0 duplicate records are found and if it's more than 0 then log with no of records. Also if there is any sqlerror then it should write the same in the log file and... (17 Replies)
Discussion started by: senmng
17 Replies
LEARN ABOUT DEBIAN
cgi::session::driver::file
CGI::Session::Driver::file(3pm) User Contributed Perl Documentation CGI::Session::Driver::file(3pm)
NAME
CGI::Session::Driver::file - Default CGI::Session driver
SYNOPSIS
$s = CGI::Session->new();
$s = CGI::Session->new("driver:file", $sid);
$s = CGI::Session->new("driver:file", $sid, {Directory=>'/tmp'});
DESCRIPTION
When CGI::Session object is created without explicitly setting driver, file will be assumed. file - driver will store session data in
plain files, where each session will be stored in a separate file.
Naming conventions of session files are defined by $CGI::Session::Driver::file::FileName global variable. Default value of this variable
is cgisess_%s, where %s will be replaced with respective session ID. Should you wish to set your own FileName template, do so before
requesting for session object:
use CGI::Session::Driver::file; # This line is mandatory.
# Time passes...
$CGI::Session::Driver::file::FileName = "%s.dat";
$s = CGI::Session->new();
For backwards compatibility with 3.x, you can also use the variable name $CGI::Session::File::FileName, which will override the one above.
DRIVER ARGUMENTS
If you wish to specify a session directory, use the Directory option, which denotes location of the directory where session ids are to be
kept. If Directory is not set, defaults to whatever File::Spec->tmpdir() returns. So all the three lines in the SYNOPSIS section of this
manual produce the same result on a UNIX machine.
If specified Directory does not exist, all necessary directory hierarchy will be created.
By default, sessions are created with a umask of 0660. If you wish to change the umask for a session, pass a UMask option with an octal
representation of the umask you would like for said session.
NOTES
If your OS doesn't support flock, you should understand the risks of going without locking the session files. Since sessions tend to be
used in environments where race conditions may occur due to concurrent access of files by different processes, locking tends to be seen as
a good and very necessary thing. If you still want to use this driver but don't want flock, set $CGI::Session::Driver::file::NoFlock to 1
or pass "NoFlock => 1" and this driver will operate without locks.
LICENSING
For support and licensing see CGI::Session
perl v5.12.4 2011-07-08 CGI::Session::Driver::file(3pm)