DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: DBMS_METADATA.get_ddl error

Threaded View

  1. #7
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    The problem here seems to be with NOT NULL constraints that are system generated as CHECK constraints. Those constraints seems to be correctly incorporated in CRATE TABLE generated with DBMS_METADATA('TABLE', table_name), but fail with DBMS_METADATA('CONSTRAINT, constraint_name).

    I thought those system-generated NOT NULL check constraints could be filtered out by using (this should be at least the closest approximation):
    Code:
    SELECT DBMS_METADATA.get_ddl('CONSTRAINT' ,constraint_name)
    FROM USER_CONSTRAINTS
    WHERE NOT (constraint_type = 'C' AND AND search_condition LIKE '%" NOT NULL';)
    but unfortuantely the column SEARCH_CONDITION in USER_CONSTRAINTS is of type long.

    So I guess the closest approximation you could get with those check constraints would be
    Code:
    SELECT DBMS_METADATA.get_ddl('CONSTRAINT' ,constraint_name)
    FROM USER_CONSTRAINTS
    WHERE NOT (constraint_type = 'C' AND GENERATED = 'GENERATED NAME');
    This of course could filter out some o your "something-different-than-not-null-check-costraint" that you didn't bother to name explicitely.
    Last edited by jmodic; 11-24-2004 at 05:21 PM.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width