PL/SQL   «Prev  Next»

Updating Rows in varray - Exercise

Updating rows within a Nested Table and varray

Objective: Build update commands for a nested table and a varray.

Exercise scoring

This exercise is worth 10 points.

Background

In this exercise, you are required to write two UPDATE statements, one each for updating a nested table and a varray. The first statement will update the data within the CUSTOMER_OBJ_TABLE table. The second statement will update the data 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. For the first UPDATE statement, build a statement to update a record from the CUSTOMER_OBJ_TABLE table, where the ID is 29 and the new values for the varray are 1-800-444-5623 and 1-310-345-8899.
  3. For the second UPDATE statement, build a statement to update a record from the SALE_HEADER table, where the ID is 34 and detail_amount within the nested table is 3.50. The item quantity must be set to 453.

Now answer this:

Please answer the following questions in the text box below to submit your answers.
  1. Is it possible to correct the existing data within a varray?
  2. How would you write a single UPDATE statement that updates all the records within a detail table?

Hints

Use the SET and WHERE clauses.

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.