I downloaded the latest Interbase from here https://altd.embarcadero.com/download/interbase/2020/latest/InterBase_2020_Windows.zip and used the trial version.
Upon installation, either as 32-bit or as 64-bit, and creating a database with all the default settings, I cannot run a view with more than two Union All Select statements. It gives the error: arithmetic exception, numeric overflow, or string truncation.
Here is the minimum reproducible error:
Install Interbase 2020 (any version of Interbase 2020, including the latest update 6 as of the time of asking this, gives the same error).
Create a new database with the default parameters (I tried also altering the default database creation parameters but it made no difference).
Create this table:
CREATE TABLE TESTTABLE1
(
AUTO1 integer NOT NULL
,NAME1 varchar(100)
,CONSTRAINT PK_TESTTABLE1_0 PRIMARY KEY (AUTO1)
);
INSERT INTO TESTTABLE1 (AUTO1, NAME1) VALUES (1, 'STUDENT1');
CREATE VIEW VIEW2 (AUTO1, CUST1) AS
SELECT
T1.AUTO1
,T1.NAME1
FROM TESTTABLE1 T1
UNION ALL
SELECT
T2.AUTO1
,T2.NAME1
FROM TESTTABLE1 T2
UNION ALL
SELECT
T3.AUTO1
,T3.NAME1
FROM TESTTABLE1 T3;
SELECT * FROM VIEW2;
Error: Error at line 1: arithmetic exception, numeric overflow, or string truncation
I noticed that when I have only one UNION ALL SELECT statement, it works correctly.
I also noted that when you show System Data(tables) and access the Data tab of the table RDB$VIEW_RELATIONS, in the view with two UNION ALL statements, it has only one entry, inserting only the last table from the select list. In the view that works, it has two tables.
Question: Is there a workaround?
This should be fixed in update 7. https://blogs.embarcadero.com/embarcadero-interbase-2020-update-7-released/