Subject | XCase and Interbase 6 |
---|---|
Author | Carlo Pettirossi |
Post date | 2001-02-07T15:39:10Z |
Hi there,
I have some problems with submitting the following script (generated by
XCase 5.52) to the Interbase 6 Superserver isql utility running under linux
Red Hat 6.2.
The script completes successfully if run under Xcase.
When I submit it to isql, MyTable is successfully created.
But the create trigger command terminates with the following error message:
Dynamic SQL Error
SQL error code = -104
Unexpected end of command
Statement: CREATE TRIGGER T_BI_MyTable FOR MyTable BEFORE INSERT AS
DECLARE VARIABLE row_count INTEGER
Could anyone suggest me how to solve this problem?
Thanks in advance
Carlo
---------------------------------------------------------------
CREATE TABLE MyTable
(
ID INTEGER NOT NULL,
IDSECONDTABLE INTEGER NOT NULL,
FIELDNAME VARCHAR(50),
FIELDVALUE BLOB SUB_TYPE 1 SEGMENT SIZE 80,
FIELDLINK VARCHAR(100),
CONSTRAINT RDB$PRIMARY56 PRIMARY KEY (ID)
);
/* Insert Trigger 'T_BI_MyTable' for Table 'MyTable' */
CREATE TRIGGER T_BI_MyTable FOR MyTable BEFORE INSERT AS
DECLARE VARIABLE row_count INTEGER;
BEGIN
IF (new.IDSECONDTABLE is not null) THEN
BEGIN
SELECT COUNT(*)
FROM SECONDTABLE
WHERE SECONDTABLE .ID = NEW.IDSECONDTABLE
INTO :row_count ;
IF (row_count = 0) THEN
BEGIN
EXCEPTION xc_i_res ;
END
END
END;
I have some problems with submitting the following script (generated by
XCase 5.52) to the Interbase 6 Superserver isql utility running under linux
Red Hat 6.2.
The script completes successfully if run under Xcase.
When I submit it to isql, MyTable is successfully created.
But the create trigger command terminates with the following error message:
Dynamic SQL Error
SQL error code = -104
Unexpected end of command
Statement: CREATE TRIGGER T_BI_MyTable FOR MyTable BEFORE INSERT AS
DECLARE VARIABLE row_count INTEGER
Could anyone suggest me how to solve this problem?
Thanks in advance
Carlo
---------------------------------------------------------------
CREATE TABLE MyTable
(
ID INTEGER NOT NULL,
IDSECONDTABLE INTEGER NOT NULL,
FIELDNAME VARCHAR(50),
FIELDVALUE BLOB SUB_TYPE 1 SEGMENT SIZE 80,
FIELDLINK VARCHAR(100),
CONSTRAINT RDB$PRIMARY56 PRIMARY KEY (ID)
);
/* Insert Trigger 'T_BI_MyTable' for Table 'MyTable' */
CREATE TRIGGER T_BI_MyTable FOR MyTable BEFORE INSERT AS
DECLARE VARIABLE row_count INTEGER;
BEGIN
IF (new.IDSECONDTABLE is not null) THEN
BEGIN
SELECT COUNT(*)
FROM SECONDTABLE
WHERE SECONDTABLE .ID = NEW.IDSECONDTABLE
INTO :row_count ;
IF (row_count = 0) THEN
BEGIN
EXCEPTION xc_i_res ;
END
END
END;