这是我第一次使用火鸟。我正在尝试创建此表。我检查了一下文件,看起来还可以。怎么了?
CREATE TABLE ENDERECO
(
ID_ENDERECO INTEGER generated by default as identity primary KEY,
RUA VARCHAR(50),
BAIRRO VARCHAR(35),
CEP VARCHAR(10),
COMPLEMENTO VARCHAR(35),
ECOMERCIO INTEGER(1),
ESTADO CHAR(2)
)
问题在于您对INTEGER(1)
的使用。数据类型INTEGER
(以及SMALLINT
和BIGINT
(在其定义中不具有精度。另请参阅Firebird 3语言参考中的数据类型声明语法:
<domain_or_non_array_type> ::=
<scalar_datatype>
| <blob_datatype>
| [TYPE OF] domain
| TYPE OF COLUMN rel.col
<scalar_datatype> ::=
SMALLINT | INT[EGER] | BIGINT
| FLOAT | DOUBLE PRECISION
| BOOLEAN
| DATE | TIME | TIMESTAMP
| {DECIMAL | NUMERIC} [(precision [, scale])]
| {VARCHAR | {CHAR | CHARACTER} VARYING} (length)
[CHARACTER SET charset]
| {CHAR | CHARACTER} [(length)] [CHARACTER SET charset]
| {NCHAR | NATIONAL {CHARACTER | CHAR}} VARYING (length)
| {NCHAR | NATIONAL {CHARACTER | CHAR}} [(length)]
简而言之,使用:
CREATE TABLE ENDERECO
(
ID_ENDERECO INTEGER generated by default as identity primary KEY,
RUA VARCHAR(50),
BAIRRO VARCHAR(35),
CEP VARCHAR(10),
COMPLEMENTO VARCHAR(35),
ECOMERCIO INTEGER,
ESTADO CHAR(2)
)