What is the result of the fallowing code?PieceInsert into table A value(a1):CREATE TABLE B AS SELECT * FROM A;ROLLBACK;A. Table B gets created with the row inserted in the first statement.B. Table B is not createdC. Table B gets created, but no row gets inserted into Table AD. Rollback throws up an exception.

This question is related to Oracle Interview

Showing Answers 1 - 13 of 13 Answers

kranti

  • Jul 28th, 2005
 

A. Table B gets created with the row inserted in the first statement.

  Was this answer useful?  Yes

Debjani

  • Aug 25th, 2005
 

Table B gets created, but no row gets inserted into Table A

  Was this answer useful?  Yes

srinivas

  • Mar 28th, 2006
 

c is the ans:

  Was this answer useful?  Yes

JAYESH SAPARIYA

  • Apr 3rd, 2006
 

C. Table B gets created, but no row gets inserted into Table A

THE TABLE WILL BE CREATED AND ALL THE ROWS ARE INSERTED INTO TABLE B BUT THEN THERE IS ROLLBACK, WHICH WILL DELETE ALL THE ROWS.

SO ANS IS C

  Was this answer useful?  Yes

pinki

  • Apr 12th, 2006
 

Ans: C

Table B gets created. As the syntax for insert is wrong, no rows will be inserted in table 'A'.

syntax for insert: insert into A values(a1);

table and value mentioned in the given piece of code are incorrect.

  Was this answer useful?  Yes

Vikas Baidya

  • May 17th, 2006
 

A> Table B gets created with the row inserted in the first statement.
Because all DDL statements are AUTO COMMIT statements and as a create command (a DDL) is issued it is automatically commited and there will not be any effect of rollback....

Vikas Baidya

Pankaj Srivastava

  • May 23rd, 2006
 

Table B gets created with the row inserted in the first statement.

Execute This Query :Insert into table A value(a1)

After That Execute this Query


CREATE TABLE B AS SELECT * FROM A;

After Execution of Create Statement. By Default Commit is Executed.

So First & Second Query are commited.

 

  Was this answer useful?  Yes

Jim Abraham

  • May 27th, 2006
 

Answer is A as table creation has auto commit after its execution so the rollback wont have any effect on the table

  Was this answer useful?  Yes

abhishek

  • Jul 26th, 2006
 

Option (A) is correct as creation of table is ddl operation which is autocommit

  Was this answer useful?  Yes

The answer here is quite simple...

first the insert statement will execute and after that a table b will get created with the data stored in the table a.

There will be no effect of the rollback. the data will get saved in the table a because the DDL commands (create, alter etc) fires the commit automatically.

  Was this answer useful?  Yes

Srikantakumar Behera

  • Oct 27th, 2006
 

'That comment is right.But 'Create' is aDDl command ,cann't rolback. '

  Was this answer useful?  Yes

Guest

  • Jan 4th, 2007
 

hi

an empty table table (B) will be created there is a mistake un the first statement

no need to commit a Create instruction, so the rollback will have no effect

good luck

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions