RE: Truncate === ????
Posted in 1998
While the drop-recreate is a fast way to go, note that problems may occur in a parent-child drop-recreate situation. Specifically, constraints linking the child to the parent will need to be looked after. This is because when a table is dropped, all child table constraints to it also get dropped. Imagine the following situation. table_parent : Parent table table_child : Child of table_parent with FK constraint If you drop-recreate table_parent, table_child's constraints to it will also be dropped. Of course, one would imagine that if you are cleaning up the parent you'd want to clean the child as well...but the sequence in which the task is done is important. This sequence will work. 1. Extract schemas of parent & child 2. drop parent and child 3. create parent 4. create child Sometimes, one wants to unload parent data, clean it and load it back without touching its children. This situation is a little more complex. Rudy ______________________________ Reply Separator _________________________________ Subject: Re: Truncate === ???? Author: "Suhas Tembe" [SMTP:stembe@arrowshirt.com] at Corporate Date: 16/11/98 11:46 AM Hi, The best & fastest way (if you want to delete all the records) would be to 'drop' the table & re-create it with indexes (if any). Suhas ------------------------ From: "T.Suresh Kumar" <sureshkt@hotmail.com> Subject: Truncate === ???? Date: Mon, 16 Nov 1998 19:55:29 +0000 Location: news://news.alterdial.uu.net/comp.databases.informix/36508331.746AE5D2@h otmail.c om To: "comp.databases.informix" <@news:comp.databases.informix@news.alterdial.uu.net> Hi I want to delete all the records from a table with a command that is similar to TRUNCATE table tablename option in ORACLE. Can any one give me how can I delete records from table very fast without using DELETE statement? Suresh ---------------End of Original Message----------------- -------------------------------------------------------- Name : Suhas Tembe E-mail: <stembe@arrowshirt.com> Date : 11/16/98 Time : 11:46:29 Place : Atlanta, Georgia. --------------------------------------------------------