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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: var source_data varchar2(12)

Re: var source_data varchar2(12)

From: <Jared.Still_at_radisys.com>
Date: Tue, 11 Nov 2003 15:44:25 -0800
Message-ID: <F001.005D6582.20031111154425@fatcity.com>


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 <maryann_30_at_yahoo.com>
Sent by: ml-errors_at_fatcity.com
 11/11/2003 01:44 PM
 Please respond to ORACLE-L  

        To:     Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
        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

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: maryann_30_at_yahoo.com

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: ListGuru_at_fatcity.com (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).

--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author:
  INET: Jared.Still_at_radisys.com

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: ListGuru_at_fatcity.com (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). Received on Tue Nov 11 2003 - 17:44:25 CST

Original text of this message

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