db2look not showing not null characterstics for columns in hierarchy tables definitio

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • azs0309
    New Member
    • Feb 2008
    • 2

    db2look not showing not null characterstics for columns in hierarchy tables definitio

    Hi all,

    I don't know i would able to explain my problem or not. I have a hierarchy tables and i want to duplicate those hierarchy tables into other database. I tried loading data with export and import. but what i have seen after importing the data is the nullability characteristics of some columns are lost..i.e in original tables they were not null and now they are null(i did "describe table" both the sides). then i used db2look to generate the DDL for the original table but i couldn't find anywhere in the table definition or structured data type definition that there is a not null defined. but I can see in the "describe table" output that the columns have not null characteristics . I don't know where to look now.

    Any suggestion or any help. Thanks in advance
  • sakumar9
    Recognized Expert New Member
    • Jan 2008
    • 127

    #2
    If your original tables has NOT NULL constraint set, then this will be present in db2look output, against the name of column.


    You can try following:
    Code:
    1. CREATE DB TEST;
    2. CONNECT TO TEST;
    3. CREATE TABLE TEST  ("IP_ID" INTEGER NOT NULL);
    4. CONNECT RESET;
    5. db2look -d test -z administrator -e -o test.out
    The db2look output is as follows:
    Code:
    -- This CLP file was created using DB2LOOK Version 9.5
    -- Timestamp: 26/02/2008 10:31:18
    -- Database Name: TEST           
    -- Database Manager Version: DB2/NT Version 9.5.0          
    -- Database Codepage: 1208
    -- Database Collating Sequence is: SYSTEM_1252
    
    
    CONNECT TO TEST;
    
    
    
    ------------------------------------------------
    -- DDL Statements for table "ADMINISTRATOR"."TEST"
    ------------------------------------------------
     
    
    CREATE TABLE "ADMINISTRATOR"."TEST"  (
    		  "IP_ID" INTEGER [U]NOT NULL[/U] )   
    		 IN "USERSPACE1" ;

    Comment

    Working...