Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Oracle Tools > Re: dynamic del...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 2670 of 2833
Post > Topic >>

Re: dynamic delete script based on columns

by DA Morgan <damorgan@[EMAIL PROTECTED] > Nov 20, 2007 at 06:05 AM

ralphbuetikofer@[EMAIL PROTECTED]
 wrote:
> hi all,
> 
> i got a big problem and hope, somebody can help. i have to create a
> dynamic delete script which has to run once a day. the script should
> find all tables containing a specific column (DEL_YN). then it should
> physically delete all records in this tables with value 'Y' in that
> column which indicates that the row has been 'deleted' by a user.
> 
> i know i can get a cursor with all table-names by the sys.all_objects
> joining with the sys.all_tab_columns to determine if the specific
> column exists in the table.
> and i do know i can use this cursor to delete the records in all the
> tables.
> 
> what i do not know is how can i assure that the delete script runs
> through the tables in the right order (i.e. dependencies,
> constraints......)??
> 
> can anybody help?
> 
> thanks in advance!
> 
> kind regards,
> bueti

Tracking down dependencies is a lot of work made simple by building
your constraints correctly. Replace your current referential constraints
with deferrable constraints and the issue goes away.

For examples of deferrable referential constraints look here:
http://www.psoug.org/reference/constraints.html#cpr
-- 
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Wa****ngton
damorgan@[EMAIL PROTECTED]
 (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
 




 2 Posts in Topic:
dynamic delete script based on columns
ralphbuetikofer@[EMAIL PR  2007-11-20 03:55:09 
Re: dynamic delete script based on columns
DA Morgan <damorgan@[E  2007-11-20 06:05:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 20:17:58 CST 2008.