Results 1 to 6 of 6

Thread: Constraint Type

  1. #1
    Join Date
    Sep 2004
    Posts
    60

    Unanswered: Constraint Type

    Hi ,

    I was firing following query to dB :
    select distinct CONSTRAINT_TYPE from dba_constraints ;
    And got following result:
    C
    -
    ?
    C
    O
    P
    R
    U
    V

    Can any body have idea what is '?' constraint_type?

    Thanks in advance.

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    No idea.

    What is result of this query:
    Code:
    SELECT * 
    FROM dba_constraints
    WHERE constraint_type IS NULL
       OR constraint_type = '?';

  3. #3
    Join Date
    Sep 2004
    Location
    London, UK
    Posts
    565
    Code:
    SQL> SELECT owner, table_name, constraint_name, search_condition
      2  FROM   dba_constraints
      3  WHERE  constraint_type = '?';
    
    OWNER        TABLE_NAME      CONSTRAINT_NAME SEARCH_CONDITION
    ------------ --------------- --------------- --------------------------------------------------
    SYS          AQ$_REPLAY_INFO SYS_C001088     "AGENT" IS NOT NULL
    
    1 row selected.
    
    SQL> set describe depth 50 linesize 60
    SQL> desc sys.AQ$_REPLAY_INFO
     Name                          Null?    Type
     ----------------------------- -------- --------------------
     EVENTID                       NOT NULL NUMBER
     AGENT                         NOT NULL SYS.AQ$_AGENT
       NAME                                 VARCHAR2(30)
       ADDRESS                              VARCHAR2(1024)
       PROTOCOL                             NUMBER
     CORRELATIONID                          VARCHAR2(128)
    From a quick test in 9.2, it seems '?' is what you get when an object type column is defined NOT NULL.

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Right; while 8.1.7 doesn't have any '?' constraint types (which I checked in the first place, as it was available to me at the moment), 10g also supports this awkward type; there is also "WRI$_ADV_DEFINITIONS" table along with "AQ$_REPLAY_INFO".

    I also thought that Abhishekdixit had SET NULL "?" set, so any NULL column would then be displayed as "?" (which also might lead to wrong conclusion as dba_constraint.constraint_type can be null). But no - this really is a '?' constraint type ...

  5. #5
    Join Date
    Sep 2004
    Posts
    60
    Thanks for your expert comments!

    I also get these two tables:
    "WRI$_ADV_DEFINITIONS"
    "AQ$_REPLAY_INFO"
    For query that is supplied in first response.

    But I haven't putted any NULL "?" anywhere.
    What I observed trying query with different dBs on different server is :
    Some give only first table as result & some give both of them as result.

    It seems a generic type of thing rather then a DBA or Developer defined one.
    Another thing is, in any case, any constraint I defined, should go to any of the generic constraints.

    Please correct me if I am wrong at any point.

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    "any constraint I defined, should go to any of the generic constraints"

    I'd say that you are right about that; your constraint will be one of 6 possible types (different from '?', of course ).

Posting Permissions

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