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 6738095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:19:35+00:00 2026-05-26T11:19:35+00:00

declare type yy is table of t12.name%type index by binary_integer; y yy; n number:=1;

  • 0
declare
type yy is table of t12.name%type index by binary_integer;
y yy;
n number:=1;
begin
execute immediate 'create table rat1 ( name varchar2(10) )';
commit;

select name bulk collect into y from t12;
for i in (select id,name from t12)
loop
dbms_output.put_line(y(n));
n:=n+1;
end loop;
forall i in y.first..y.last
insert into rat1 values(y(i));
end;

Its giving ora-00942.
I checked about it…at some website it was mentioning that you have to give following privilages…

grant select on sys.v_$paramenter to abc

I am unable to do that also..Can any body help me 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-05-26T11:19:36+00:00Added an answer on May 26, 2026 at 11:19 am

    change it so that it is executed in 2 successive steps (NOT in one PL/SQL anonymous block like it is now):

    First this

    begin
    execute immediate 'create table rat1 ( name varchar2(10) )';
    commit;
    end;
    

    THEN as a SECOND block this

    declare
    type yy is table of t12.name%type index by binary_integer;
    y yy;
    n number:=1;
    begin
    
    select name bulk collect into y from t12;
    for i in (select id,name from t12)
    loop
    dbms_output.put_line(y(n));
    n:=n+1;
    end loop;
    forall i in y.first..y.last
    insert into rat1 values(y(i));
    end;
    

    EDIT – as per comment:

    Before execution the WHOLE PL/SQL block is parsed – all objects used in an PL/SQL block must exist BEFORE the PL/SQL block is executed…

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

Sidebar

Related Questions

declare type array is table of src%rowtype index by binary_integer; l_data array ; begin
I have a table containing a column of type Number create table tmp (
I have one question about EXECUTE IMMEDIATE. I have dynamicly changed table name in
create table foo( id number, status varchar2(10) ); Table created. insert into foo values(
Here's my user-defined table type... CREATE TYPE [dbo].[FooType] AS TABLE( [Bar] [INT], ) This
Here is my SQL query Declare @Type varchar select if (tn.notification_type=1) begin set @Type=
I have a User-Defined Table Type called tvpInsertedColumns : CREATE TYPE [Audit].[tvpInsertedColumns] AS TABLE(
I have oracle block like DECLARE TYPE emp_array IS VARRAY(100) OF VARCHAR2(30); VAR_PRESENTADDRESS1 varchar2(100);
When you declare a type parameter for the class, you can simply use that
Is there a way to forward-declare the HINSTANCE type from the WinAPI without including

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.