Subject | RE: [firebird-support] Possible UNION problem in CREATE VIEW |
---|---|
Author | Leyne, Sean |
Post date | 2009-10-23T19:48:58Z |
Dave,
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
;
> I am using Firebird 2.1.3. The documentation leads me to believe thatNot a direct solution to the problem you are dealing with, but a more general issue.
> UNION queries in CREATE VIEW DDL statements are fully supported in FB
> 2.0+.
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
;