On 25-07-2026 10:37, 'Dimitry Sibiryakov' via firebird-devel wrote:
> in current state of v6 tables are schema-qualified and can be
> packaged. How to get list of fields for a table knowing only its name?
If you know only it's name, then 1) it cannot possibly be a packaged
table, so you can ignore that case, and 2) you need to use the search
path to locate the table.
For example, to identify unqualified tables, Jaybird uses:
with SEARCH_PATH as (
select row_number() over() as PRIO, NAME as SCHEMA_NAME
from SYSTEM.RDB$SQL.PARSE_UNQUALIFIED_NAMES(rdb$get_context('SYSTEM',
'SEARCH_PATH'))
)
select r.RDB$SCHEMA_NAME
from RDB$RELATIONS as r
inner join SEARCH_PATH s on r.RDB$SCHEMA_NAME = s.SCHEMA_NAME and
r.RDB$RELATION_NAME = ?
order by s.PRIO
fetch first row only
Mark
--
Mark Rotteveel