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

  • SEARCH
  • Home
  • 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 8089737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:29:53+00:00 2026-06-05T19:29:53+00:00

I want to show the content of a nested table using a cursor. I’ve

  • 0

I want to show the content of a nested table using a cursor. I’ve try the following but it does not work. The arguments in the “put_line” are not correct but I don’t know why.

create or replace type toys_t as table of varchar2(40);

create or replace type kid_t as object (name varchar2(10), toys toys_t);

create table kid of kid_t nested table toys store as table_toys;

insert into kid values('Bob', toys_t('truck','ball','doll'));

select t.* from kid k, table(k.toys) t where k.name = 'Bob';


declare

cursor cursor_table is
   select t.* from kid k, table(k.toys) t where k.name = 'Bob';

begin

   for i in cursor_table loop
      dbms_output.put_line(i);
   end loop;

end;

It’s very simple. A kid have a name and a list of toys and I want to show the toys but not from a “select” but a cursor.

Thanks from your help.

Bob

  • 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-05T19:29:55+00:00Added an answer on June 5, 2026 at 7:29 pm

    You need to reference the column name in the loop

    SQL> ed
    Wrote file afiedt.buf
    
      1  declare
      2    cursor cursor_table is
      3     select t.* from kid k, table(k.toys) t where k.name = 'Bob';
      4  begin
      5     for i in cursor_table loop
      6        dbms_output.put_line(i.column_value);
      7     end loop;
      8* end;
    SQL> /
    truck
    ball
    doll
    
    PL/SQL procedure successfully completed.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to show page loading spinner in my html page content using jquery
I want to get a nested DIV tag using KRL query() but it complains
I am creating a project using ASP.NET MVC. I want to show content of
I have a menu that changes and I want to show content in the
I want to show datagrid content (rows,columns) in XPS document.I have 20 columns. When
On my Wordpress blog, I want to show additional content to people from Finland
I have some content I want to show in iframe with fancybox. When I
I'm currently using JTable to show the contents in database. I want to provide
I'm using Drupal 7 and Views module in my site. And want show number
I want to validate the first field and show content in other. Check date

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.