Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: select max into a @variable


Message #1 by "Fotopoulos, Lefteris" <LFot@e...> on Fri, 27 Jul 2001 14:28:28 +0300
declare the variable as

v_count   number;
e.g:
select max(emp_id)
into v_count
from employee;
now the variable v_count holds the value of the max(emp_id) and can be used.
----- Original Message -----
From: "Fotopoulos, Lefteris" <LFot@e...>
To: "sql language" <sql_language@p...>
Sent: Friday, July 27, 2001 7:28 AM
Subject: [sql_language] select max into a @variable


> How can i select max(column) into a stored_proc variable?
>
> e.g. set @var = select max(column) from table.
>
> So i want @var to hold the number that 'select max(column) from table'
> returns
>
>

  Return to Index