Re: ocp: sql: question?

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: 22 Apr 2003 00:41:00 -0700
Message-ID: <a20d28ee.0304212341.607368d5_at_posting.google.com>


"ks" <kshathrya_at_attbi.com> wrote in message news:<QSAoa.13050$Si4.6203_at_rwcrnsc51.ops.asp.att.net>...
> i came across this in some place.
> can someone explain:
>
> Q 1.
> The PRODUCT table contains these columns:
> PRODUCT_ID NUMBER PK
> NAME VARCHAR2(30)
> LIST_PRICE NUMBER(7,2)
> COST NUMBER(7,2)
>
> You logged on to the database to update the PRODUCT table. After your
> session began, you issued these statements:
> INSERT INTO product VALUES(4,'Ceiling Fan',59.99, 32.45);
> INSERT INTO product VALUES(5,'Ceiling Fan',69.99,37.20);
> SAVEPOINT A;
> UPDATE product SET cost = 0;
> SAVEPOINT B;
> DELETE FROM product WHERE UPPER(name) = 'CEILING FAN';
> ALTER TABLE product ADD qoh NUMBER DEFAULT 10;
> ROLLBACK TO B;
> UPDATE product SET name = 'CEILING FAN KIT' WHERE product_id = 4;
>
> Then you exit iSQL*Plus. Which of the statements you issued were committed?
> A. only the INSERT statements
> B. only the INSERT statements and the first UPDATE statement
> C. the INSERT statements, the first UPDATE statement, and the DELETE
> statement
> D. all of the DML operations
> E. none of the DML operations
>
> Ans: D

All DDL implicitly commits. ALTER TABLE is DDL. The rollback is redundant, because the transaction has already been committed and all savepoints cleared.
Exiting sql*plus performs a commit.

D is the correct answer.
TRY it!!!

Regards

Sybrand Bakker
Senior Oracle DBA Received on Tue Apr 22 2003 - 09:41:00 CEST

Original text of this message