Hi all,

This is the email I sent earlier - I think it was lost in the 7.2 release
hammering the servers got.

I'm hoping to implement SET NULL / SET NOT NULL for 7.3

I've been searching the SQL99 docs but I still can't figure out the syntax
for it.  (BTW, can anyone give me SQL92?)

So I guess there are two possibilties - which is correct?:

ALTER TABLE blah ADD CONSTRAINT "asfd" NOT NULL (field);
ALTER TABLE blah DROP CONSRAINT "asdf";

or

ALTER TABLE	blah ALTER COLUMN field SET [ NOT NULL | NULL ];

My question is - does the parser already support the syntax?  ie. Is there
an empty function somewhere that says 'not implemented', or do I have to
actually add the flex code for it?

If it is there - where is it?

Chris


Wed, 13 Feb 2002 10:46:46 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
SET NULL / SET NOT NULL
Christopher Kings-Lynne writes:

> I'm hoping to implement SET NULL / SET NOT NULL for 7.3
>
> I've been searching the SQL99 docs but I still can't figure out the syntax
> for it.

There isn't really a syntax for it.  SQL only allows you to add table
constraints, not column constraints.  A NOT NULL constraint is a shorthand
notation for a CHECK constraint, so to add a NOT NULL constraint you'd
have to recognize CHECK constraints of the form CHECK (col IS NOT NULL)
and handle them specially.  To drop NOT NULL constraints, you'd use the
regular ALTER TABLE blah DROP CONSTRAINT foo; where foo is the name of the
NOT NULL constraint.  The drawback is that NOT NULL constraints currently
don't have a name stored.

-- 
Peter Eisentraut   peter_e@gmx.net


Tue, 19 Feb 2002 17:50:37 -0500 (EST)
Peter Eisentraut <peter_e@gmx.net>
Re: SET NULL / SET NOT NULL