Sponsored Content
Top Forums Shell Programming and Scripting Need help with procedure and parameters in a script Post 302536313 by adshocker on Tuesday 5th of July 2011 05:13:36 AM
Old 07-05-2011
Need help with procedure and parameters in a script

Hi,

I'm trying to create a procedure within my script and what I want is something like:

Code:
myproc () {
  PARM1=value after -t
  PARM2=value after -y
}

myproc -t "PARM1 Value" -y "PARM2 Value"

Of course that won't work since there's no such command as "value after -t". But this is what I'm trying to achive.

I'm on AIX by the way.

Thanks.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Starting a script from a Database procedure

Hey guys, I have this problem : I can run on an sqlprompt !ftp_file2.ksh test.xml 172.16.204.81 Anonymous Anonymous which will ftp the file from Unix to an NT machine, but if I do exec shell('sh ftp_file2.ksh test.xml 172.16.204.81 Anonymous Anonymous') it does NOTHING. I have no... (4 Replies)
Discussion started by: vidireporting
4 Replies

2. Shell Programming and Scripting

DB2 stored procedure (with input parameters) from script

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)
Discussion started by: mpang_
1 Replies

3. Shell Programming and Scripting

Passing parameters form unix to Oracle procedure

Hi, I have screen which was desined in PL/SQL Catridges in apps. In that screen some enterable fields these values r the passing parameters to create value sets, functions, menus etc in apps by using front end screens. Now in that screen i have a button. when i click that button it have to... (0 Replies)
Discussion started by: rajasekharamy
0 Replies

4. Shell Programming and Scripting

calling procedure from script

Hi All, My script will call a storedprocedure #!/bin/bash # # Script for ........... . ../conf/setting.env # Environment file to set the DATABASE #TODAY=`date '+%Y%m%d_%H'` #echo TODAY = $TODAY sqlplus -s $DATABASE <<EOF spool $TRACKING_LOGDIR/CalcFreqPgsVues_H.log exec... (3 Replies)
Discussion started by: scorpio
3 Replies

5. Shell Programming and Scripting

getting proper o/p from a procedure in a script

foll. is my code snippet. #!/bin/ksh retVal=`sqlplus -s user/passwd@oracle_sid <<EOF SET SERVEROUTPUT ON SIZE 100000 DECLARE STATUS_VALUE CHAR; BEGIN SELECT temp1 INTO STATUS_VALUE FROM sai; DBMS_OUTPUT.PUT_LINE(STATUS_VALUE); END; / SET... (1 Reply)
Discussion started by: sainathdeg
1 Replies

6. Shell Programming and Scripting

Executing Procedure from shell script..

Hello, I created a sql file to create a Procedure, and it was successfully created. I created a sql file to execute the procedure, and it did without any errors, but i dont see the data been updated. The Execute procedure.sql script is: BEGIN set serveroutput on size 1000000 execute... (5 Replies)
Discussion started by: msrahman
5 Replies

7. Shell Programming and Scripting

How to get OUT parameter of a stored procedure in shell script?

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)
Discussion started by: vel4ever
6 Replies

8. Shell Programming and Scripting

Executing procedure using script

Hi, I want to have a automted script to exceute 20 procedures one by one. Suppose below is one procedure once it get executed script will write "PL/SQL procedure successfully completed." to a log for ex- exec dbms_stats.gather_table_stats(); Now later procedure starts executing... (1 Reply)
Discussion started by: sv0081493
1 Replies

9. Shell Programming and Scripting

Sub script calling procedure

Hi, I have a doubt regarding how sub scripts will be executed and interested to know internal workflow, For example - My main script is A,it calls a script B then B will call some C....and so on. Then B script run parallel to A or it will wait B to execute then A will continue. ... (1 Reply)
Discussion started by: nag_sathi
1 Replies

10. Shell Programming and Scripting

Why i can't execute the procedure in shell script?

i have the following code inside a shell script .prog in oracle server when i call the program DBMS_OUTPUT.PUT_LINE(x_return_status|| ln_rep_req_id); will return 0 , it is very strange , i try to submit the concurrent request in oracle , and it can successfully executed, what am i missing ? i... (1 Reply)
Discussion started by: feilhk
1 Replies
OCI_NEW_CURSOR(3)														 OCI_NEW_CURSOR(3)

oci_new_cursor - Allocates and returns a new cursor (statement handle)

SYNOPSIS
resource oci_new_cursor (resource $connection) DESCRIPTION
Allocates a new statement handle on the specified connection. PARAMETERS
o $connection - An Oracle connection identifier, returned by oci_connect(3) or oci_pconnect(3). RETURN VALUES
Returns a new statement handle, or FALSE on error. EXAMPLES
Example #1 Binding a REF CURSOR in an Oracle stored procedure call <?php // Precreate: // create or replace procedure myproc(myrc out sys_refcursor) as // begin // open myrc for select first_name from employees; // end; $conn = oci_connect("hr", "hrpwd", "localhost/XE"); if (!$conn) { $m = oci_error(); trigger_error(htmlentities($m['message']), E_USER_ERROR); } $curs = oci_new_cursor($conn); $stid = oci_parse($conn, "begin myproc(:cursbv); end;"); oci_bind_by_name($stid, ":cursbv", $curs, -1, OCI_B_CURSOR); oci_execute($stid); oci_execute($curs); // Execute the REF CURSOR like a normal statement id while (($row = oci_fetch_array($curs, OCI_ASSOC+OCI_RETURN_NULLS)) != false) { echo $row['FIRST_NAME'] . "<br /> "; } oci_free_statement($stid); oci_free_statement($curs); oci_close($conn); ?> NOTES
Note In PHP versions before 5.0.0 you must use ocinewcursor(3) instead. This name still can be used, it was left as alias of oci_new_cursor(3) for downwards compatability. This, however, is deprecated and not recommended. PHP Documentation Group OCI_NEW_CURSOR(3)
All times are GMT -4. The time now is 08:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy