Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Passing Unix Vars to a Stored Procedure

Re: Passing Unix Vars to a Stored Procedure

From: Martin Doherty <martin.doherty_at_nospam.com>
Date: Fri, 03 Jan 2003 10:25:18 -0800
Message-ID: <AFkR9.14$Kp5.125@news.oracle.com>


Martin,

Inside your proc.sql script, refer to the command line parameters as &1, &2 etc. and call your procedure like this: execute martinproc ('&1', '&2', '&3');

SQL*Plus will do a straight character substitution before executing the command. I've assumed that all your parameters have a character data type. For other data types, your PL/SQL procedure should validate and cast to the appropriate type (e.g. to_number, to_date).

Regards
Martin

rmartin wrote:

>I need to pass Unix variables to a PL/SQL Stored Proc.
>
>I call the procedure like so (I've ommited the sql logon info etc):
>
>@proc.sql $1 $2 $3
>
>But how do I access these in my Stored Proc?
>
>What is the notation for assigning a Unix var to a Stored Proc IN Var?
>
>Thanks in advance.
>
>
>
>
Received on Fri Jan 03 2003 - 12:25:18 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US