Subject Re: [firebird-support] Cannot create tables in new FB 2.5 DB, fails with error 335544351 on commit
Author Woody
From: "peterbelow@..." <peter.below@...>
> I'm trying to get started with using Firebird.
> Downloaded Firebird-2.5.0.26074_1_Win32.exe and used it to install
> Firebird as "super classic" server (on Windows XP SP3). I was able to
> create a new user, create a new database, added an alias for it in
> alias.conf. I can connect to the database using this new account, both
> with FlameRobin (0.9.2) or ISQL, I can create domains, exceptions, stored
> procedures.
>
> I cannot create tables, though.
> I execute
>
> CREATE TABLE HL_Oids (
> OID OidKey NOT NULL PRIMARY KEY
> );
>

Peter,

Nice to see you giving FB a go. The syntax is a little off for Firebird
when creating primary key constraints. Try something like this:

CREATE TABLE HL_Oids(
OID OidKey NOT NULL CONSTRAINT OID_Key PRIMARY KEY
);

In FB, you have to name the constraint if you want to create it yourself. If
you leave off the CONSTRAINT portion, FB will create one with combined not
null fields. If you want a primary key constraint containing more than one
field, you would put the constraint at the end of the table definition:

CREATE TABLE HL_Oids(
OID OidKey NOT NULL,
Nother_Field INT NOT NULL,

CONSTRAINT OID_KeyTwo PRIMARY KEY (OID, Nother_Field)
);

Also, I am assuming the the OidKey declaration is a field type that you
defined already.

HTH

Woody (TMW)