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

NAME
inviso_lfm - An Inviso Off-Line Logfile Merger DESCRIPTION
Implements an off-line logfile merger, merging binary trace-log files from several nodes together in chronological order. The logfile merger can also do pid-to-alias translations. The logfile merger is supposed to be called from the Erlang shell or a higher layer trace tool. For it to work, all logfiles and trace information files (containing the pid-alias associations) must be located in the file system accessible from this node and organized according to the API description. The logfile merger starts a process, the output process, which in its turn starts one reader process for every node it shall merge logfiles from. Note that the reason for a process for each node is not remote communication, the logfile merger is an off-line utility, it is to sort the logfile entries in chronological order. The logfile merger can be customized both when it comes to the implementation of the reader processes and the output the output process shall generate for every logfile entry. EXPORTS
merge(Files, OutFile) -> merge(Files, WorkHFun, InitHandlerData) -> merge(Files, BeginHFun, WorkHFun, EndHFun, InitHandlerData) -> {ok, Count} | {error, Reason} Types Files = [FileDescription] FileDescription = FileSet | {reader,RMod,RFunc,FileSet} FileSet = {Node,LogFiles} | {Node,[LogFiles]} Node = atom() LogFiles = [{trace_log,[FileName]}] | [{trace_log,[FileName]},{ti_log,TiFileSpec}] TiFileSpec = [string()] - a list of one string. FileName = string() RMod = RFunc = atom() OutFile = string() BeginHFun = fun(InitHandlerData) -> {ok, NewHandlerData} | {error, Reason} WorkHFun = fun(Node, LogEntry, PidMappings, HandlerData) -> {ok, NewHandlerData} LogEntry = tuple() PidMappings = term() EndHFun = fun(HandlerData) -> ok | {error, Reason} Count = int() Reason = term() Merges the logfiles in Files together into one file in chronological order. The logfile merger consists of an output process and one or several reader processes. Returns {ok, Count} where Count is the total number of log entries processed, if successful. When specifying LogFiles , currently the standard reader-process only supports: * one single file * a list of wraplog files, following the naming convention <Prefix><Nr><Suffix> . Note that (when using the standard reader process) it is possible to give a list of LogFiles . The list must be sorted starting with the oldest. This will cause several trace-logs (from the same node) to be merged together in the same OutFile . The reader process will simply start reading the next file (or wrapset) when the previous is done. FileDescription == {reader,RMod,RFunc,FileSet} indicates that spawn(RMod, RFunc, [OutputPid,LogFiles]) shall create a reader process. The output process is customized with BeginHFun , WorkHFun and EndHFun . If using merge/2 a default output process configuration is used, basically creating a text file and writing the output line by line. BeginHFun is called once before requesting log entries from the reader processes. WorkHFun is called for every log entry (trace message) LogEntry . Here the log entry typically gets writ- ten to the output. PidMappings is the translations produced by the reader process. EndHFun is called when all reader processes have terminated. Currently the standard reader can only handle one ti-file (per LogFiles ). The current inviso meta tracer is further not capable of wrapping ti-files. (This also because a wrapped ti-log will most likely be worthless since alias associations done in the beginning are erased but still used in the trace-log). The standard reader process is implemented in the module inviso_lfm_tpreader (trace port reader). It understands Erlang linked in trace-port driver generated trace-logs and inviso_rt_meta generated trace information files. WRITING YOUR OWN READER PROCESS
Writing a reader process is not that difficult. It must: * Export an init-like function accepting two arguments, pid of the output process and the LogFiles component. LogFiles is actually only used by the reader processes, making it possible to redefine LogFiles if implementing an own reader process. * Respond to {get_next_entry, OutputPid} messages with {next_entry, self(), PidMappings, NowTimeStamp, Term} or {next_entry, self(), {error,Reason}} . * Terminate normally when no more log entries are available. * Terminate on an incoming EXIT-signal from OutputPid . The reader process must of course understand the format of a logfile written by the runtime component. Ericsson AB inviso 0.6.2 inviso_lfm(3erl)
All times are GMT -4. The time now is 04:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy