Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Dropping constraints

Re: Dropping constraints

From: Kirill Richine <krichine_at_radss.com>
Date: Tue, 13 Jul 1999 15:31:56 GMT
Message-ID: <378b5a20.68804044@news.cadvision.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US