Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Dropping constraints
On Sun, 11 Jul 1999 11:41:18 GMT, man_at_sjoki.uta.fi wrote:
>
>
>Hello,
>
>I'd like to disable a "NOT NULL" constraint using a simple script.
>The problem is that it is difficult to track the name of the
>constraint from the user constraints table, since the search_condition
>column is LONG.
While I don't know the answer to your question, you can also drop it with a command:
alter table DOCUMENTS modify (
STATUS_ID NULL
);
If you want to create a bulk script that fills in table and column names automatically, you can query user_tab_columns view for TABLE_NAME, COLUMN_NAME, and NULLABLE fields, something like this:
select 'alter table ' || table_name || ' modify ( ' || column_name ||
' NULL );'
from user_tab_columns
where nullable = 'N'
and ... <all your table_name, column_name conditions>
k. Received on Tue Jul 13 1999 - 10:31:56 CDT
![]() |
![]() |