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

Home -> Community -> Usenet -> c.d.o.server -> Re: "SELECT" output into a variable.

Re: "SELECT" output into a variable.

From: <mzawadzki_at_starnet.lenfest.com>
Date: 1998/03/27
Message-ID: <6fg92t$gmb$1@news1.fast.net>#1/1

something like :

	REM -- column <name> new_value <variable-to-bind> noprint
	column lnsmax   new_value _lnsmax noprint
	REM -- note SUM(width) is aliased to  lnsmax
	select SUM(width) lnsmax from col where tname = 'TABLE_NAME');
         	REM -- and use the set variable (&&<var>)
	set lines &&_lnsmax


See the COLUMN command in the "SQL*Plus User's Guide and Reference " for more info.
Andres de Zordo <andres_at_crcs.tensor.pgs.com> wrote:

>People,
 

> Does any one knows how can I set the value of a variable
>from the output of a SELECT statment in SQLPLUS?
 

> What I need is some thing like this:
 

>define VARIABLE=(select SUM(width) from col where tname = 'TABLE_NAME')
>set line &VARIABLE
 

> Thanks.

Mark Zawadzki, late of Waynesboro, Va.
'...there is not a sprig of grass that shoots uninteresting to me.'

                                                 Thomas Jefferson, 1790. 
Received on Fri Mar 27 1998 - 00:00:00 CST

Original text of this message

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