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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:01:26+00:00 2026-05-31T05:01:26+00:00

I have create the following tables and types…. CREATE TYPE ACTOR_QUOTE_TYPE AS OBJECT (

  • 0

I have create the following tables and types….

CREATE TYPE  ACTOR_QUOTE_TYPE AS OBJECT ( 
Movie_Title  CHAR(36),
Year NUMBER,
Role  CHAR(36),
Quote CHAR(255)
)
/

CREATE TYPE AQ_NT AS TABLE OF  ACTOR_QUOTE_TYPE
/

CREATE TABLE ACTOR_QUOTES (
ACTORID CHAR(5),
QUOTES  AQ_NT
)  NESTED TABLE QUOTES STORE AS ACTOR_QUOTES_NT
/

I need to create an…..

A PL/SQL procedure called INIT_ACTOR_QUOTES with no parameters that:

Reads ALL the ACTORIDs from the ACTOR table and INSERTs them into the ACTORID attribute for each row the ACTOR_QUOTES table (the tables have the same cardinality) and at the same time INSERTs the following initial values into the first row only of the QUOTES nested table into each row of the ACTOR_QUOTES table;

(Movie_Title, Year, Role, Quote) are set respectively to (‘ ‘,NULL ,’ ‘, ‘ ‘)

Also and at the same time immediately after each INSERT use DELETE to delete ALL the rows from the nested table in each row belonging to each ACTORID in the ACTOR_QUOTES table.

I’m getting a compilation error with the code….

CREATE OR REPLACE PROCEDURE INIT_ACTOR_QUOTES 
AS
CURSOR actorID_cursor IS
SELECT actorID FROM Actor;
BEGIN 

FOR row IN actorID_cursor LOOP
INSERT actorID INTO ACTOR_QUOTES;

INSERT INTO actor_Quotes_NT VALUES ('', NULL, ' ', '');
DELETE (*) FROM actor_Quotes_NT ('', NULL, ' ', ''); 
END LOOP; 
END INIT_ACTOR_QUOTES ;

/ 
Warning: Procedure created with compilation errors.






SQL> show errors;
Errors for PROCEDURE INIT_ACTOR_QUOTES:

 LINE/COL ERROR
 -------- -----------------------------------------------------------------
 7/2      PL/SQL: SQL Statement ignored    
 7/9      PL/SQL: ORA-00925: missing INTO keyword
 9/2      PL/SQL: SQL Statement ignored
 9/10     PL/SQL: ORA-00928: missing SELECT keyword
 SQL> 

Any Help Please….

  • 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-31T05:01:29+00:00Added an answer on May 31, 2026 at 5:01 am

    First error: when inserting into a table we have to insert values into all the columns or otherwise just specify the ones we are populating.

    Second error: when referencing a column in a cursor we have to reference the variable we’re fetching data into i.e. row in your ill-named example.

    Third: when populating a user-defined type we have to name the type in the assignment.

    Fourth: when populating a nested table we have to name both it and the object type it collects.

    Fifth: a nested table is a column on the table and so should be assigned in the INSERT statement, or subsequently with an UPDATE.

    So what you really want is something which looks like this:

     insert into ACTOR_QUOTES
        (actorid, quote)s
     values
        ( row.actorid
          , AQ_NT ( 
               ACTOR_QUOTE_TYPE  
                 ('Dirty Harry', 1970, 'Inspector Callahan', 'Do you feel lucky punk?')
              , ACTOR_QUOTE_TYPE  
                 ('Sudden Impact', 1983, 'Inspector Callahan', 'Make my day')
            )
       );
    

    By the by, on the topic of ill-named variables, don’t call anything AQ. That is a recognized abbreviation for the Oracle Advance Queueing feature, so it’s just going to cause a world of confusion.

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

Sidebar

Related Questions

I have the following tables CREATE TABLE `files` ( `fileid` int(11) NOT NULL AUTO_INCREMENT,
I have the following tables: CREATE TABLE title ( booktitle VARCHAR( 60 ), title_id
I have the following table: CREATE TABLE TEST(ID TINYINT NULL, COL1 CHAR(1)) INSERT INTO
I have two tables with the following schema: CREATE TABLE sales_data ( sales_time date
I have the following tables: CREATE TABLE `attendance_event_attendance` ( `id` int(11) NOT NULL AUTO_INCREMENT,
I have the following two tables defined... CREATE TABLE [LogLevel] ( [Id] int primary
Lets say i have: create type address as object ( line1 varchar2(50), city varchar2(50),
I have the following table: create table ARDebitDetail(ID_ARDebitDetail int identity, ID_Hearing int, ID_AdvancedRatePlan int)
I have the following table structure CREATE TABLE `table` ( `id` int(11) NOT NULL
I have the following table: $sql = CREATE TABLE received_queries ( sender_screen_name varchar(50), text

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.