The 'var' variable can be used as a bind variable in pl/sql.

Variables referenced with & or && are substution variables.

The code in your example looks incomplete to me, or the programmer
just didn't bother to complete it, as Mladen has already suggested.

Here's a ( rather useless) example of using both substitution
and bind variables in sqlplus.

var cmd_line_arg varchar2(10)

begin
   select '&&1' into :cmd_line_arg from dual;
end;
/

print cmd_line_arg

HTH,

Jared



Maryann Atkinson <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]

 11/11/2003 01:44 PM
 Please respond to ORACLE-L

       
        To:        Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
        cc:        
        Subject:        var source_data  varchar2(12)



My original posting had a few lines truncated, so here I go again:

I'm looking at a PL/SQL script that goes like this

-- Header
var Source_Data  VARCHAR2(12)

DECLARE
       Num1   NUMBER;

BEGIN
     Source_Data := '&1';

What's the purpose of having a VAR statement in front or Before
of the Declare section? Is it used for bind-variables, is that what it is?

thx
maa

--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Maryann Atkinson
 INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


Reply via email to