Re: Question Regarding Select Into

From: kumar <muthu.kumar_at_fmr.com>
Date: 27 Dec 2005 02:01:37 -0800
Message-ID: <1135677697.114688.323800_at_g47g2000cwa.googlegroups.com>


Hi ,

[Quoted]         I tried the same thing with an anonymous plsql block. i got some errors, just wondering if i have understood it correctly and executed in the correct way.

  1 declare
  2 a varchar2(30);
  3 begin
  4 select person_id into nvl(a,'asdf') from per_all_people_f where person_id = 110;
  5* end;
SQL> /
select person_id into nvl(a,'asdf') from per_all_people_f where person_id = 110;

                       *

ERROR at line 4:
ORA-06550: line 4, column 24:
PLS-00306: wrong number or types of arguments in call to 'NVL'
ORA-06550: line 4, column 38:

PL/SQL: ORA-00904: : invalid identifier
ORA-06550: line 4, column 1:
PL/SQL: SQL Statement ignored

and i tried this as well

NVL(min(FIELDNAME),'empty') or max()

  1 declare
  2 a varchar2(30);
  3 begin
  4 select nvl(min(person_id),'asdf') into a from per_all_people_f where person_id = 110;
  5* end;
SQL> /
declare
*
ERROR at line 1:
ORA-01722: invalid number
ORA-06512: at line 4

please clarify. Received on Tue Dec 27 2005 - 11:01:37 CET

Original text of this message