Hi All,
I sure hope someone will be able to help me with this issue, first a little background.
I work for a software company and the programmer that used to write the database scripts did not use a standardard naming convention for the foreign key constraints, they changed from one verstion to another. I have since standardize them, however, this only works for the new customers, not the existing ones.
I would like to send our existing customers a script that would create another script that would drop the foreign key constraints in their database, then I can have them add new constraints with the standardize names.
I have found out the following script gets me the correct information, but I can't figure how to create the script itself -
I had though about using the "utl_file" but I can't guarentee that the customers will have their system setup correctly.
I would like the script (results) to look something like this -
Does anyone have any ideas?
Thank you for your time,
Trey
I sure hope someone will be able to help me with this issue, first a little background.
I work for a software company and the programmer that used to write the database scripts did not use a standardard naming convention for the foreign key constraints, they changed from one verstion to another. I have since standardize them, however, this only works for the new customers, not the existing ones.
I would like to send our existing customers a script that would create another script that would drop the foreign key constraints in their database, then I can have them add new constraints with the standardize names.
I have found out the following script gets me the correct information, but I can't figure how to create the script itself -
Code:
select table_name, constraint_name
from dba_constraints
where owner = 'TEST4'
and constraint_type = 'R'
and constraint_name like 'RI%'
I had though about using the "utl_file" but I can't guarentee that the customers will have their system setup correctly.
I would like the script (results) to look something like this -
Code:
Alter table ADJUSTMENT_CODES Drop Constraint RI_REF_1373623_1;
Alter table VENDOR_CONTRACTS Drop Constraint RI_REF_1612467_5;
Alter table RECEIVING_ADJUSTMENTS Drop Constraint RI_REF_1612469_5;
Alter table RECEIVING_DETAIL_ADJUSTS Drop Constraint RI_REF_1612470_4;
Does anyone have any ideas?
Thank you for your time,
Trey