Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: truncate table

Re: truncate table

From: DA Morgan <damorgan_at_psoug.org>
Date: Wed, 25 May 2005 16:27:35 -0700
Message-ID: <1117063391.380350@yasure>


Matthias Hoys wrote:

> <Bullseye> wrote in message 
> news:efo991dss2qh10tlfeanurdpjulhomsif8_at_4ax.com...
> 

>>Hi!
>>
>>I have a problem - Can anyone help?
>>
>>I have a requirement to lock a table (to deny all write access to it),
>>update records in another table, and then to truncate the "locked"
>>table before allowing access to it.
>>
>>The problem is that the truncate table issues a commit (which is fine)
>>but the commit releases my lock and allows queued transactions to
>>commit BEFORE actionning the truncate (Of it seems to!).
>>
>>How can I ensure that the truncate table is executed before any other
>>transactions are committed bu other processes?
>>
>>TIA
> 
> 
> SELECT ... FROM ... FOR UPDATE locks the entire table.
> 
> 
> HTH
> Matthias

Or alternatively ... use the DBMS_LOCK package to write your own lock.

-- 
Daniel A. Morgan
Relational theory is not something that is simply a nice-to-have.
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Wed May 25 2005 - 18:27:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US