oracle9i,pl/sql

In this forum you can share stuff related to Oracle 11g, 10g, 9i.
Post Reply
kareem2003
Posts: 40
Joined: Tue Jun 12, 2007 11:25 am
Location: India
Contact:

oracle9i,pl/sql

Post by kareem2003 »

what is diff of between delete and trancate ,
who can apply commit on triggers
amirtai
Posts: 138
Joined: Sat Apr 08, 2006 5:54 pm
Location: Canada
Contact:

Post by amirtai »

Hi

DELETE is like removing bricks one by one from a structure. If any wrong brick is removed you can put it back in the structure. Rows are deleted 1 by 1 from table and stored in rollback segment for read consistancy. There are some overheads involved since if you decide to undo you can get them back from flashback righaway or rollback later before commit.

However the truncate is like you demolish the structure completely. The techqniue simply removes the segment from the used list and put it back in free list. No undo is generated so less overhead.

NOTE: Even dropped table/object can be brought back (as of 10g) but never use truncate unless you are not sure about contents might be needed later. Keeping a backup before truncate is good practice.

COMMIT is a restrictive sub program, so not allowed to be interacting with all triggers though. However triggers like WHEN/KEY at Item level are able to commit changes better you check with version specific list of available triggers that can use commit.

On the other hand DATABASE TRIGGERS can be used to commit data in any table within database. Often used for keep track of changes (audit trial).

Thanks
Amir
kareem2003
Posts: 40
Joined: Tue Jun 12, 2007 11:25 am
Location: India
Contact:

Post by kareem2003 »

thinks sir,
if u r know oracle give replay,
i have table like as
23 24 24 24
22 22
33 33
then output comes like
23,24,24,24
22,,,22
33,,33,
but i need as follows
23,24,24,24
22,22
33,33
how sir?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest