db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ян Программист <webautoma...@gmail.com>
Subject Re: GROUP BY
Date Sat, 10 Apr 2010 15:29:09 GMT
>From my previous post:

I created following DDL:

create table server_shutdown_type
(
id integer(3) not null,
name varchar(10) not null,
primary key(id)
Ru);
create table server_shutdown_log
(
record_id integer not null,
shutdown_type integer not null,
admin_records VARCHAR(30),
primary key (record_id),
foreign key (shutdown_type) references server_shutdown_type (id)
);

select SYS.SYSCOLUMNS.COLUMNNAME, SYS.SYSCOLUMNS.COLUMNDATATYPE,
SYS.SYSCONSTRAINTS.TYPE, SYS.SYSCONSTRAINTS.REFERENCECOUNT from
SYS.SYSCOLUMNS inner join SYS.SYSTABLES on SYS.SYSTABLES.TABLEID =
SYS.SYSCOLUMNS.REFERENCEID INNER JOIN SYS.SYSCONSTRAINTS on
SYS.SYSCOLUMNS.REFERENCEID = SYS.SYSCONSTRAINTS.TABLEID where
SYS.SYSTABLES.TABLENAME like 'SERVER%';
COLUMNNAME
                                                   |COLUMNDATATYPE
|&|REFERENCEC&
--------------------------------------------------------------------------------------------------------------------------------------------------------------
ADMIN_RECORDS
                                                    |VARCHAR(30)    |P|0

ADMIN_RECORDS
                                                    |VARCHAR(30)    |F|0

RECORD_ID
                                                    |INTEGER NOT NU&|P|0

RECORD_ID
                                                    |INTEGER NOT NU&|F|0

SHUTDOWN_TYPE
                                                    |INTEGER NOT NU&|P|0

SHUTDOWN_TYPE
                                                    |INTEGER NOT NU&|F|0

ID
                                                   |INTEGER NOT NU&|P|1

NAME
                                                   |VARCHAR(10) NO&|P|1

Hence columns NAME, ADMIN_RECORDS appear with 'P' value
for  SYS.SYSCONSTRAINTS.TYPE. But I haven't forced those to be primary keys
in DDL. John

Mime
View raw message