Subject | Re: [firebird-support] primary key not null? |
---|---|
Author | Sergio H. Gonzalez |
Post date | 2009-05-07T21:40:45Z |
> I've just tested and it seems that FB silently added not null flag toYes... you are right... Thanks Dimitry!
> field declared as primary key.
> If you create table with nullable column and then try to alter it
> adding primary key, FB will complain.
But I still found it a bit strange.. look at my metadata... ID is nullable... I
would expect a "not null" in the ID field declaration...
Anyway... I still love FB !!!
/* Generated by IBExpert 2008.08.08 07/05/2009 06:29:12 p.m. */
SET SQL DIALECT 3;
SET NAMES ISO8859_1;
CREATE DATABASE 'C:\sg\Delphi\Lukas\DATOS.FDB'
USER 'SYSDBA' PASSWORD 'baronusaadmin'
PAGE_SIZE 4096
DEFAULT CHARACTER SET ISO8859_1;
/*Domains*/
CREATE DOMAIN ID AS
NUMERIC(9,0);
/*Tables*/
CREATE TABLE BANCOS (
ID ID,
NOMBRE DESCRIPCION,
[...]
);
/*Primary Keys*/
ALTER TABLE BANCOS ADD CONSTRAINT PK_BANCOS PRIMARY KEY (ID);
COMMIT WORK;