How do i put multiple values in a variable?
885842Sep 1 2011 — edited Sep 1 2011Hi, very new to PLSQL but could anybody please help with this problem?
If i do the following statement it works fine:
select salary,name from employers where salary = (select max (salary) from employers) ;
But if i am doing it in PLSQL im stuck in how to assign 2 values into a variable.
I can do the following using just salary:
declare
v1 varchar2 (30);
begin
select salary into v1 from employers where salary = (select max (salary) from employers) ;
end;
However if i try select salary,name into v1 from employers where salary = (select max (salary) from employers) ;
i get the following error:
ORA-06550: line 65, column 31:
PL/SQL: ORA-00947: not enough values
ORA-06550: line 65, column 4:
PL/SQL: SQL Statement ignored
Many thanks
Thank you very much this is answered - unbelievably quick response !!
Edited by: 882839 on 01-Sep-2011 08:51