Rachel,
I've no idea why you are trying to do this but if it's a one off thing then
why not unload to a file and then remove the create index/constraint
commands then reload?
If it's something you want to do regularly then you will need to delete the
foreign keys before the primary ones. Maybe an easy way to do this would be
to project a series of temporary tables - which will have no constraints or
indexes - then drop the original tables and project the temp tables back to
the original name. I think you'll still need to watch the sequence of tables
but you can create a (permanent) table to do that and run through it with a
cursor.
Regards,
Alastair.
----- Original Message -----
From: "Rachael Malberg" <[EMAIL PROTECTED]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Thursday, April 24, 2008 5:51 PM
Subject: [RBASE-L] - Re: Droping a databases Indexes
yeah, I've been trying a couple things like your suggestions but since I'm
looking to drop primary, foreign, and indexed indexes I had to create two
views, one with 'alter table drop constrain' order by sys_primary_key and
another for my 'drop index' and wrote them out to a file. Worked pretty
but when I ran my file I couldn't get threw it all till I got an 'Access
violation error..' and it put a table lock on the last table 'altered'.
So I'm off to plan B...thanks for the assistance.
----- Original Message -----
From: "James Bentley" <[EMAIL PROTECTED]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Thursday, April 24, 2008 11:27 AM
Subject: [RBASE-L] - Re: Droping a databases Indexes
Rachael,
No quick command to drop all indexes. Try the following command
file to create another command file to DROP the indexes.
SET HEADINGS OFF
OUTPUT DRPIDX.RMD
WRITE '-- Drop of all indexes'
SELECT DISTINCT ('DROP INDEX
`'+sys_index_name+'`--'+sys_table_name)=60 +
FROM sys_indexes t1 INNER +
JOIN sys_tables t2 ON t1.sys_table_id=t2.sys_table_id +
WHERE t2.sys_table_type='TABLE' AND (0=(t1.sys_primary_key++
t1.sys_unique_index+t1.sys_foreign_key+t1.sys_dbf_idx))
OUTPUT SCREEN
SET HEADINGS ON
RETURN
-- I suggest you first do "RBEDIT DRPIDX.RMD" to check out that
you
-- have created commands to drop the proper indexes.
-- you would then "RUN DRPIDX.RMD" to delete the indexes
If you cut and paste my code be sure that each line is properly
continued as the email program my have split it at inappropriate
places.
Jim Bentley
--- Rachael Malberg <[EMAIL PROTECTED]> wrote:
is there a quick way to drop all db indexes?
Jim Bentley
American Celiac Society
[EMAIL PROTECTED]
tel: 1-504-737-3293
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
--
No virus found in this incoming message.
Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.4/1394 - Release
Date: 23/04/2008 19:16