Re: CHECK-Constraint mit WHERE ?
Martin Spott <Martin(dot)Spott(at)mgras(dot)net> schrieb am 22.06.2006 15:58:26:
>
> Tobias Bußmann wrote:
>
> > CONSTRAINT enforce_covertype CHECK ((geomtype LIKE 'POLYGON%') AND
> > (covertype >= 0 AND covertype < 6)) OR NOT (geomtype LIKE 'POLYGON%')
>
> Fast!, die Klammerung hat 'nen Fehler, den der komplette Ausdruck
> hinter dem CHECK muss geklammert werden, die LIKE-Ausdruecke kommen
> hingegen auch ohne Klammer aus:
>
> CONSTRAINT enforce_covertype CHECK (
> (geomtype LIKE 'POLYGON%' AND (covertype >= 0 AND covertype < 6))
> OR geomtype NOT LIKE 'POLYGON%'
> )
>
> .... funktioniert,
> Martin.
> --
Hallo,
geht das nicht einfacher:
CONSTRAINT enforce_covertype CHECK (
geomtype NOT LIKE 'POLYGON%'
OR (covertype >= 0 AND covertype < 6)
)
??
Christoph
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000071
Home |
Main Index |
Thread Index