Deleting a Row from the object_products Table : Delete « Object Oriented « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> CREATE Or Replace TYPE ProductType AS OBJECT (
  2    id          NUMBER,
  3    name        VARCHAR2(15),
  4    description VARCHAR2(22),
  5    price       NUMBER(5, 2),
  6    days_valid  NUMBER
  7  )
  8  /

Type created.

SQL>
SQL> CREATE TABLE object_products OF ProductType
  2  /

Table created.

SQL>
SQL> INSERT INTO object_products (
  2    id, name, description, price, days_valid
  3  ) VALUES (
  4    1, 'AAA', 'BBB', 2.99, 5
  5  );

1 row created.

SQL>
SQL> select * from object_products;

 ID NAME            DESCRIPTION                 PRICE DAYS_VALID
--- --------------- ---------------------- ---------- ----------
  1 AAA             BBB                          2.99          5

SQL>
SQL> DELETE FROM object_products
  2  WHERE id = 1;

1 row deleted.

SQL>
SQL> select * from object_products;

no rows selected

SQL>
SQL> drop table object_products;

Table dropped.

SQL>








32.13.Delete
32.13.1.Deleting a Row from the object_products Table
32.13.2.Deleting a Row from the Table with object type column
32.13.3.DELETE from object table where clause reference object's attributes