Loading Consent Dialog

Table Modification   «Prev  Next»

Lesson 2 Concepts for modifying object tables
Objective Describe Key Concepts for modifying Object Tables

Describe Key Concepts for Modifying Object Tables

You can use DML to insert, update, and delete records from object tables, in much the same way that you can use it on relational tables.
However, there are some subtle differences, which are listed below:
  1. An object table may contain a column that is associated with an object type. In such case, you must specify the object type name to insert or update the records.
  2. Updating a record within an object table requires the use of table name aliases.
  3. In the case of object tables that contain references to other objects, you must use the REF operator to insert and update the records.
There are two ways to insert and update the records within object tables:
  1. Specify all the values for inserting or updating the records
  2. Query within an INSERT or UPDATE statement to perform the DML operation

Restrictions on DML-Enabled Java Stored Procedures

If you perform DML (Data Manipulation Language) actions inside of a Java Stored Procedure, Oracle places these restrictions on how the procedure or function can be used:
  1. It cannot be called from a SELECT statement or parallelized DML statement.
  2. It cannot be called from an INSERT, UPDATE, or DELETE statement if the statement modifies the same tables as the Stored Procedure
  3. It cannot be called from a SELECT, INSERT, UPDATE, or DELETE statement if it performs any transaction management (for example, calling commit() or rollback()). By extension, it cannot execute any DDL (Data Definition Language) statements since these are automatically committed by Oracle.
  4. It cannot be called from a SELECT, INSERT, UPDATE, or DELETE statement if it performs system or session control functions.
Attempts to violate these restrictions are met with a run-time error. In the next lesson, we will look at writing DML statements to insert records into object tables.