Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-00947: not enough values for select into

Sid_ Z.Oct 3 2015 — edited Oct 3 2015

Hi All,

I have created object type and its nested table type to hold the values.

But am getting error as follows:

Connected to Personal Oracle Database 10g Release 10.2.0.1.0

Connected as hr

SQL>

SQL> create or replace type t_obj as object

  2  ( id number,

  3    dt date

  4   );

  5  /

Type created

SQL> create or replace type t_obj_nt is table of t_obj;

  2  /

Type created

SQL> set serveroutput on

SQL>

SQL>  declare

  2   l_tab t_obj_nt;

  3 

  4   begin

  5 

  6    select level,(sysdate+ level) into l_tab

  7    from dual connect by level < 5;

  8 

  9   dbms_output.put_line(l_tab.count);

10   end;

11  /

declare

l_tab t_obj_nt;

begin

  select level,(sysdate+ level) into l_tab

  from dual connect by level < 5;

dbms_output.put_line(l_tab.count);

end;

ORA-06550: line 8, column 3:

PL/SQL: ORA-00947: not enough values

ORA-06550: line 7, column 3:

PL/SQL: SQL Statement ignored

SQL>

Regards

Sid

This post has been answered by Saubhik on Oct 3 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 31 2015
Added on Oct 3 2015
2 comments
1,129 views