Re: How do add primary key contraint on existing table?
Posted in 1997
> :but I get an ISAM error message that says it has run out of disk space. > : Keep in mind, if you alter a table Informix makes a copy of that table before making changes to it. If your table is very big, you just might not have enough room for the copy. A quicker way of doing your trim would be to: 1- generate a schema for the table in question. 2- change the name of the table to something else 3- save the constraints from the schema in a separate file 4- create the new table 5- disable the constraints 6- insert into newtable select * from oldtable ( this is much faster than load from bla bla bla, since it is using page reads and writes) 7- Once you VERIFY that the new table has the records you want to save, drop the old table. 8- rename newtable to oldtable name 9- enable constraints for the newtable 10- run the file with the constraints. 11- update stats If you put this into a script you will save some time on how you do these steps. But, you will notice a cut in the time it takes to do your trim. -- Jorge Torralba Intel Information Technology HF2-71 (503)696-4587 5200 NE Elam Young Parkwa jorge_torralba@ccm2.hf.intel.com Hillsboro, Or 97124 ============================================================= Any views or opinions expressed by me do not reflect those of Intel Corp.