Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7834917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:23:55+00:00 2026-06-02T13:23:55+00:00

create table foo( id number, status varchar2(10) ); Table created. insert into foo values(

  • 0
 create table foo(
   id number,
   status varchar2(10)
 );

Table created.

insert into foo values( 1, 'open' );
insert into foo values( 2, 'close' );
insert into foo values( 3, 'open' );
insert into foo values( 4, 'open' );
insert into foo values( 5, 'close' );

create type foo_obj is object (
      id number,
      status varchar2(10)
    );
   /

 create type foo_nt
     as table of foo_obj;
  /

 create or replace package test_bulk
 is 

 procedure temp;

 end;
 /

 create or replace package body test_bulk
 is 

 procedure  temp
   is 
   v_nt  foo_nt;
   begin
     select id ,status 
     bulk collect into v_nt
     from foo;

   end temp;

   end test_bulk;

This is a very odd situation, when I create a type object and nested table of that type Globally and create a variable of the nested table type and bulk collect into that variable I get

ORA-00947: not enough values error

However, when I declare a record type and nested table of that record type And then a variable of the nested table Inside the package , then the above bulk collect works and it will not throw error

Can anyone help me out with this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T13:23:57+00:00Added an answer on June 2, 2026 at 1:23 pm

    You can’t just put values into a table of objects – you need to convert the values into objects of the appropriate type and then insert the objects. Try

    procedure temp is
      v_nt  foo_nt;
    begin
      select FOO_OBJ(id ,status)
        bulk collect into v_nt
        from foo;
    end temp;
    

    Not tested on animals – you’ll be first!

    Share and enjoy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following test-code: CREATE TABLE #Foo (Foo int) INSERT INTO #Foo SELECT
The following T/SQL:- create table #temp(foo varchar(10)) insert into #temp select '' insert into
If I issue the following commands: CREATE TABLE foo LIKE bar; INSERT INTO bar
I have my own type: CREATE TYPE MyType AS TABLE ( foo INT )
I have a table like this: create table foo ( a number, b number
I need ID to be an eight whole digit number. create table foo( ID
I create quasi-boolean columns like this: CREATE TABLE foo bar NUMBER(1) DEFAULT 0 NOT
create table foo (id int(11) auto_increment, value varchar(255)) The table contains roughly 10,00,000 rows
Consider a simple table with an auto-increment column like this: CREATE TABLE foo (
For the sake of the example, consider a table create table foo ( contents

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.