Subject | RE: [firebird-support] May a foreign key field differ in trailing spaces from its referenced field? |
---|---|
Author | Leyne, Sean |
Post date | 2011-01-21T17:04:07Z |
> CREATE TABLE PRUEBA1 (Trailing spaces are trimmed for VarChar columns, this is part of SQL conformance.
> CODIGO VARCHAR(10) NOT NULL
> );
> ALTER TABLE PRUEBA1 ADD CONSTRAINT PK_PRUEBA1 PRIMARY KEY
> (CODIGO);
>
> CREATE TABLE PRUEBA2 (
> CODIGO VARCHAR(10) NOT NULL,
> COD_PRUEBA1 VARCHAR(10)
> );
> ALTER TABLE PRUEBA2 ADD CONSTRAINT PK_PRUEBA2 PRIMARY KEY
> (CODIGO); ALTER TABLE PRUEBA2 ADD CONSTRAINT FK_PRUEBA2_1
> FOREIGN KEY (COD_PRUEBA1) REFERENCES PRUEBA1 (CODIGO);
>
> Is it correct that you can insert into field PRUEBA2.COD_PRUEBA1 a value that
> differs in trailing spaces from the code referenced in PRUEBA1?
Sean