Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: "SELECT" output into a variable.
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