isColumn's NOT NULL info stored in system catalog table? 
Author Message
 isColumn's NOT NULL info stored in system catalog table?

Hi:

I am learning DB2 now and I have created one table in DB2 6.1 Workgroup
version on NT:

CREATE TABLE T1(
    C1    DECIMAL(2, 0)    NOT NULL,
    C2    VARCHAR(30)      NOT NULL);

My question is: Is C1 and C2's not null info stored somewhere in system
catalog table?  In oracle, I could do something like:

select * from user_constraints where CONSTRAINT_TYPE ='C'

to find that. I am wondering where in DB2 this info is stored.

Thanks.

Guang

Sent via Deja.com http://www.***.com/
Before you buy.



Fri, 23 Aug 2002 03:00:00 GMT
 isColumn's NOT NULL info stored in system catalog table?

Hi,
To describe individual statements, one can do:
    DESCRIBE <select statement>;

To select characteristics of a particular table columns, one can select
from
the system catalog table:
    SYSCAT.COLUMNS.

And to generate host language declerations, one can use the
decleration generator tool:
    db2dclgn -d <database> -t <table> <a long list of options>

Hope this helps,
David.

Quote:

> Hi:

> I am learning DB2 now and I have created one table in DB2 6.1 Workgroup
> version on NT:

> CREATE TABLE T1(
>     C1    DECIMAL(2, 0)    NOT NULL,
>     C2    VARCHAR(30)      NOT NULL);

> My question is: Is C1 and C2's not null info stored somewhere in system
> catalog table?  In oracle, I could do something like:

> select * from user_constraints where CONSTRAINT_TYPE ='C'

> to find that. I am wondering where in DB2 this info is stored.

> Thanks.

> Guang

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Fri, 23 Aug 2002 03:00:00 GMT
 isColumn's NOT NULL info stored in system catalog table?
use:
SELECT * FROM SYSCAT.COLUMNS WHERE TABSCHEMA=USER and TABNAME='T1'

The nullable info is stored in column NULLS.

Phil Castle
Cardett Associates

Quote:

> Hi:

> I am learning DB2 now and I have created one table in DB2 6.1 Workgroup
> version on NT:

> CREATE TABLE T1(
>     C1    DECIMAL(2, 0)    NOT NULL,
>     C2    VARCHAR(30)      NOT NULL);

> My question is: Is C1 and C2's not null info stored somewhere in system
> catalog table?  In oracle, I could do something like:

> select * from user_constraints where CONSTRAINT_TYPE ='C'

> to find that. I am wondering where in DB2 this info is stored.

> Thanks.

> Guang

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Sat, 24 Aug 2002 03:00:00 GMT
 isColumn's NOT NULL info stored in system catalog table?
In DB2 UDB nullability is a column property rather than a constraint.
So you find the info in SYSCAT.COLUMNS.
(I aggree that for completeness the information should be mirrored
in the constraint catalog).

Cheers
Serge

Quote:

> look at sysibm.syscolumns.


>> Hi:

>> I am learning DB2 now and I have created one table in DB2 6.1
>> Workgroup
>> version on NT:

>> CREATE TABLE T1(
>>     C1    DECIMAL(2, 0)    NOT NULL,
>>     C2    VARCHAR(30)      NOT NULL);

>> My question is: Is C1 and C2's not null info stored somewhere in
>> system
>> catalog table?  In oracle, I could do something like:

>> select * from user_constraints where CONSTRAINT_TYPE ='C'

>> to find that. I am wondering where in DB2 this info is stored.

>> Thanks.

>> Guang

>> Sent via Deja.com http://www.deja.com/
>> Before you buy.



Sun, 01 Sep 2002 03:00:00 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Most system catalog columns should be NOT NULL

2. views info in system catalog

3. Request for Info: Journaling Ingres System Catalogs

4. not null column during CTAS(not null definition did not come across)

5. like '%' not return null's

6. HOWTO: Declare table field having Default Value - NULL or NOT NULL

7. How to change the table column from NULL to NOT NULL

8. How to change from Null to Not Null in Table Specs

9. Cannot drop the table '#T1', because it does not exist in the system catalog.

10. Cannot drop the table 'test', because it does not exist in the system catalog.


 
Powered by phpBB® Forum Software