Subject RE: [firebird-support] Possible UNION problem in CREATE VIEW
Author Leyne, Sean
Dave,

> I am using Firebird 2.1.3. The documentation leads me to believe that
> UNION queries in CREATE VIEW DDL statements are fully supported in FB
> 2.0+.

Not a direct solution to the problem you are dealing with, but a more general issue.

You realize you are "talking the long road" to get the details you are looking for?

This approach is much more direct to get the list of tables in the database:

CREATE VIEW INFORMATION_SCHEMA_TABLES(
TABLE_CATALOG,
TABLE_SCHEMA,
TABLE_NAME,
TABLE_TYPE
) AS

SELECT
NULL AS TABLE_CATALOG ,
NULL AS TABLE_SCHEMA ,
RDB$RELATION_NAME AS TABLE_NAME,
CASE WHEN (RDB$VIEW_BLR IS NULL) THEN 'BASE TABLE' ELSE 'VIEW' END AS TABLE_TYPE
FROM RDB$RELATIONS
WHERE
RDB$SYSTEM_FLAG=0
;