Reputation: 140
I have a situation like this.
I have to write a PL/SQL procedure to delete ALL child tables of a parent table and modify the length of the column which was referenced in the child table.
I need to take input from the user these parameters. parent table name parent column name (whose column size is to be altered ) new column size
I am new to PL/SQL programming .Please help me.
Thanks in advance.
Upvotes: 0
Views: 752
Reputation: 36987
I'm not going to do your job here, but these hints should help you:
all_cons_columns
where table_name='*name of the parent table*' and column_name='*name of the column you want to alter*'
all_conststraints
where constraint_type='R' and r_constraint_name='*name of the primary key constraint found in step one*'
EXECUTE IMMEDIATE
to execute the DML statements to drop the child tables and alter the parent tableUpvotes: 1