Re: Constraint question
Posted in 1993
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Triggers, Constraints & Referential Integrity
In article <1v8id4INNgij@emory.mathcs.emory.edu> jparker@hpbs2561.boi.hp.com (Jack Parker) writes:
>>
>> This is a question that _should_ easily be answered in the documentation,
>> but it was apparently written by drunken baboons.
>
>uneccessary.
When two programmers experienced with databases can't find an answer after
several days of effort of tracking cross-references, there is a problem.
A big problem.
If I alone can't find something in the documentation, I have a problem.
When several people working together can't find something, the documentation
is broken.
>> HOW DO YOU _DEFINE_ A CONSTRANT?
>>
>> We've checked every book in our release and while we know how to
>> define a table with constrants, add constrants to an existing table,
>> remove constrants from a table, construct valid names for constrants,
>> etc., _NOWHERE_ does it say how to define one.
>
>When you add a constraint, you ARE defining one.
Example from CREATE TABLE, from page 3-42 of the ESQL/C manual.
create table tab1
(c1 integer not null unique constraint uc1,
c2 integer,
c3 integer not null,
c4 char(10) not null,
unique (c3, c4));
elsewhere we've seen references to "constraint code" and "constraint num".
Both of us parse that first column as:
define a new column called "c1". c1
this column contains integers INTEGER
do not let this column contain nulls NOT NULL
do not let this column contain duplicate entries UNIQUE
apply additional constraint CONSTRAINT UC1
We've checked the language syntax (in another book) and it states
that "constraint" must be followed by an identifier, so "uc1" isn't
simply a synonym for "c1." There are also several references to
using arbitrary constraints with a view (using a "where" clause).
It seems that "uc1" is a similar constraint applied at the relation
level, but we can't find any information on how to use it _or_
indicating that we misinterpreted something.
--
Bear Giles
bear@fsl.noaa.gov
-<My views rarely reflect those of my employer or the Federal government>-