Sponsored Content
Top Forums Shell Programming and Scripting Execute an Oracle stored procedure from a shell scrip Post 73738 by mh53j_fe on Friday 3rd of June 2005 03:10:04 PM
Old 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

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

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

3. Shell Programming and Scripting

How to execute an Oracle procedure using shell

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

Invoking Oracle stored procedure in unix shell script

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

how to pass the values to unix shell from the oracle stored procedure.

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

how to call oracle stored procedure from unix shell

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

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

Execute a shell script from Oracle procedure

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

Unable to execute Stored Procedure from CRON

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

Shell script to execute Oracle procedure and trigerring email on success and failure

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
rb(3erl)						     Erlang Module Definition							  rb(3erl)

NAME
rb - The Report Browser Tool DESCRIPTION
The Report Browser (RB) tool makes it possible to browse and format error reports written by the error logger handler log_mf_h . EXPORTS
filter(Filters) filter(Filters, Dates) Types Filters = [filter()] filter() = {Key, Value} | {Key, Value, no} | {Key, RegExp, re} | {Key, RegExp, re, no} Key = term() Value = term() RegExp = string() | {string, Options} | mp(), {mp(), Options} Dates = {DateFrom, DateTo} | {DateFrom, from} | {DateTo, to} DateFrom = DateTo = {date(), time()} date() and time() are the same type as in the This function displays the reports that match the provided filters. When a filter includes the no atom it will exclude the reports that match that filter. The reports are matched using the proplists module. The report must be a proplist to be matched against any of the filters() . If the filter is of the form {Key, RegExp, re} the report must contain an element with key = Key and Value must match the RegExp regular expression. If the Dates parameter is provided, then the reports are filtered according to the date when they occurred. If Dates is of the form {DateFrom, from} then reports that occurred after DateFrom are displayed. If Dates is of the form {DateTo, to} then reports that occurred before DateTo are displayed. If two Dates are provided, then reports that occurred between those dates are returned. If you only want to filter only by dates, then you can provide the empty list as the Filters parameter. See rb:grep/1 for more information on the RegExp parameter. grep(RegExp) Types RegExp = string() | {string, Options} | mp(), {mp(), Options} All reports containing the regular expression RegExp are printed. RegExp can be a string containing the regular expression; a tuple with the string and the options for compilation; a compiled regu- lar expression; a compiled regular expression and the options for running it. Refer to the module re and specially the function re:run/3 for a definition of valid regular expressions and options. h() help() Prints the on-line help information. list() list(Type) Types Type = type() type() = crash_report | supervisor_report | error | progress This function lists all reports loaded in the rb_server . Each report is given a unique number that can be used as a reference to the report in the show/1 function. If no Type is given, all reports are listed. rescan() rescan(Options) Types Options = [opt()] Rescans the report directory. Options is the same as for start() . show() show(Report) Types Report = int() | type() If a type argument is given, all loaded reports of this type are printed. If an integer argument is given, the report with this ref- erence number is printed. If no argument is given, all reports are shown. start() start(Options) Types Options = [opt()] opt() = {start_log, FileName} | {max, MaxNoOfReports} | {report_dir, DirString} | {type, ReportType} | {abort_on_error, Bool} FileName = string() | standard_io MaxNoOfReports = int() | all DirString = string() ReportType = type() | [type()] | all Bool = true | false The function start/1 starts the rb_server with the specified options, while start/0 starts with default options. The rb_server must be started before reports can be browsed. When the rb_server is started, the files in the specified directory are scanned. The other functions assume that the server has started. {start_log, FileName} starts logging to file. All reports will be printed to the named file. The default is standard_io . {max, MaxNoOfReports} . Controls how many reports the rb_server should read on start-up. This option is useful as the directory may contain 20.000 reports. If this option is given, the MaxNoOfReports latest reports will be read. The default is 'all'. {report_dir, DirString} . Defines the directory where the error log files are located. The default is {sasl, error_logger_mf_dir} . {type, ReportType} . Controls what kind of reports the rb_server should read on start-up. ReportType is a supported type, 'all', or a list of supported types. The default is 'all'. {abort_on_error, Bool} . This option specifies whether or not logging should be aborted if rb encounters an unprintable report. (You may get a report on incorrect form if the error_logger function error_msg or info_msg has been called with an invalid format string). If Bool is true , rb will stop logging (and print an error message to stdout) if it encounters a badly formatted report. If logging to file is enabled, an error message will be appended to the log file as well. If Bool is false (which is the default value), rb will print an error message to stdout for every bad report it encounters, but the logging process is never aborted. All printable reports will be written. If logging to file is enabled, rb prints * UNPRINTABLE REPORT * in the log file at the location of an unprintable report. start_log(FileName) Types FileName = string() Redirects all report output from the RB tool to the specified file. stop() Stops the rb_server . stop_log() Closes the log file. The output from the RB tool will be directed to standard_io . Ericsson AB sasl 2.1.9.3 rb(3erl)
All times are GMT -4. The time now is 02:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy