Subject | Re: [firebird-support] Illegal use of keyword VALUE |
---|---|
Author | Helen Borrie |
Post date | 2006-03-30T12:52:16Z |
At 10:21 PM 30/03/2006, you wrote:
name, not VALUE (use VALUE when applying a check constraint to a domain):
CREATE TABLE RESERVAS_STOCK(CODIGO_DEPOSITO integer NOT NULL,
NUMERO_TERMINAL SMALLINT NOT NULL,
CODIGO_PRODUCTO integer NOT NULL,
CANTIDAD INTEGER NOT NULL CHECK(CANTIDAD > 0),
TIPO_RESERVA SMALLINT NOT NULL CHECK(TIPO_RESERVA in (1,2)))
./hb
>Hi. Can anyone tell me what's wrong with this statement?When declaring a check constraint at table level, use the column
>
>CREATE TABLE RESERVAS_STOCK(CODIGO_DEPOSITO D_CODIGO_DEPOSITO NOT NULL,
>NUMERO_TERMINAL SMALLINT NOT NULL,
>CODIGO_PRODUCTO D_CODIGO_PRODUCTO NOT NULL,
>CANTIDAD INTEGER NOT NULL CHECK(value > 0),
>TIPO_RESERVA SMALLINT NOT NULL CHECK(value in (1,2)));
>
>It returns:
>Unsuccessful execution caused by system error that does not preclude
>successful execution of subsequent statements.
>Dynamic SQL Error.
>SQL error code = -901.
>Illegal use of keyword VALUE.
>
>Using FB 1.5.3
name, not VALUE (use VALUE when applying a check constraint to a domain):
CREATE TABLE RESERVAS_STOCK(CODIGO_DEPOSITO integer NOT NULL,
NUMERO_TERMINAL SMALLINT NOT NULL,
CODIGO_PRODUCTO integer NOT NULL,
CANTIDAD INTEGER NOT NULL CHECK(CANTIDAD > 0),
TIPO_RESERVA SMALLINT NOT NULL CHECK(TIPO_RESERVA in (1,2)))
./hb