not null constraint and dbschema in SE 7
Posted in 2000
Topics: Security, Permissions & Auditing, Clustering, Grid & MACH11
Another problem when migrating from SE 5 to SE 7 ...
DBSCHEMA Schema Utility INFORMIX-SQL Version 7.23.UC13 on SCO
OpenServer 5.0.5
dbschema of SE 7 generates for example :
...
create table "abdo".conesc
(
tipcon char(1) not null constraint "root".n233_554,
con char(20) not null ,
des char(40) not null constraint "root".n233_556,
pre decimal(8) not null constraint "root".n233_557
);
revoke all on "abdo".conesc from "public";create unique cluster index "abdo".conesc_i1 on "abdo".conesc (tipcon,
con);
...
1. Why is adding a constraint that I have not created ? Is there any
trick?
2. Why is it creating over some columns only ?
2.1 what happen with ´con´ ?
2.2 is it ugglier than the others ?
I will be condemned to filter the output of dbschema with something like
...
sed 's/not null constraint.*/not null, -- /g'
...
Thanks in advance
--
Evelio Martínez
Tel: +34 96 337-95-80
Fax: +34 96 337-81-18
Evelio Martínez wrote:
> Another problem when migrating from SE 5 to SE 7 ...
>
> DBSCHEMA Schema Utility INFORMIX-SQL Version 7.23.UC13 on SCO
> OpenServer 5.0.5
>
> dbschema of SE 7 generates for example :
> ...
> create table "abdo".conesc
> (
> tipcon char(1) not null constraint "root".n233_554,
> con char(20) not null ,
> des char(40) not null constraint "root".n233_556,
> pre decimal(8) not null constraint "root".n233_557
> );
> revoke all on "abdo".conesc from "public";> create unique cluster index "abdo".conesc_i1 on "abdo".conesc (tipcon,
> con);
> ...
>
> 1. Why is adding a constraint that I have not created ? Is there any
> trick?
>
Informix 7.xx versions adhere to the new SQL standard and define NOT NULL
as a constraint, in earlier SQL versions it was an attribute of the column.
You can
get my dbschema replacement utility, myschema, which can do everything
dbschemacan do (except the -hd option) and MUCH MUCH more including changing those
pesky NOT NULL constraints back into attributes. Myschema is part of the
package utils2_ak available from the IIUG Software Repository.
> 2. Why is it creating over some columns only ?
> 2.1 what happen with ´con´ ?
> 2.2 is it ugglier than the others ?
>
That's an odd one all right. It should have done con also. If you had not
asked I
would have chalked the omission up to a typo on your part transferring it to
the
posting.
>
> I will be condemned to filter the output of dbschema with something like
>
> ...
> sed 's/not null constraint.*/not null, -- /g'
This is just one of the reasons I have maintained myschema despite
improvements in
dbschema and major changes to the system catalog, table structure, SQL DDL,
and
the engines for over ten years.
Art S. Kagel