PL/SQL   «Prev  Next»

Inserting Rows into varray - Exercise

I am working with the Oracle PL/SQL language. What is the difference between a PL/SQL 1) varray and 2) nested table?

Inserting rows into nested Table

Objective:Write an INSERT statement to insert a row into a nested table.

Exercise scoring

This exercise is worth a total of 10 points. You will receive up to five points for writing the INSERT statement and displaying the results with the correct syntax. You will receive up to five points for adding an explanation.

Background

Write an INSERT statement to insert a row into the nested table within the SALE_HEADER table.

Instructions

  1. With SQL*Plus, connect to the database by using PETSTORE as the username, GREATPETS as the password, and MYDB as the host string.
  2. Approve the entries.
  3. Build an INSERT statement to insert a record into the varray within the CUSTOMER_OBJ_TABLE table.
The values for the record are as follows: cust_id is 56, name of the person is Norma Grey residing at 100 South East Main Burbank CA 65443 having the following phone numbers: 1-800-876-3243 and 1-714-785-8763. Joan last updated the record on 12/22/99.

Answer Question:

Please answer the following questions in the text box below to submit your answers.
  1. Can you specify the column names for the INSERT statement and insert data into only a few columns?
  2. If so, how?

Hints

Use ADDRESS_TYPE, which is an object type, and PHONE_ARRAY, which is a varray type of collection.

Submitting your exercise


Type (or cut and paste) your plan into the box below to submit your answers.
Click the Submit button when finished to submit the exercise. Remember to submit all of your answers at once.