I am a beginner with Interbase (always used Advantage and SQL Server) and I am now running into a problem that is probably very easy to fix, but I'm just not seeing it (nor can I find a usable hint in the documentation). Please consider the following (condensed script):
CREATE DOMAIN DOM_ID AS INTEGER;
CREATE TABLE Relatie (
ID DOM_ID NOT NULL,
RelatieNaam VARCHAR(100),
Bedrijf VARCHAR(40),
CONSTRAINT PK_RELATIE PRIMARY KEY (ID)
);
This script fails (using 'Prepare') with error message 'Dynamic SQL error. SQL Error code = -104. Token unknown - line 2, char 1 CREATE'.
I first thought creating the domain requires a Commit but as per documentation that's not required here since it's a DDL statement.
What am I doing wrong / am I overlooking?
I have no experience with this but looks like you are having problem with first CREATE.
And when I search found this link. https://docwiki.embarcadero.com/InterBase/2020/en/Creating_a_Domain
As I see there are additional lines with "EXEC SQL" before and "COMMIT;" after CREATE DOMAIN.
Also, it is written: "Once a domain is defined and committed, it can be used in CREATE TABLE statements to define columns."
Hope this helps.