Subject Re: [firebird-support] Access Table Column Metadata
Author Martijn Tonies

> I have a PHP application that imports data from a Tab Delimited text file.
> I need to validate that the text file is correctly formatted (ie. Has the
> correct number of elements per line, that elements are 'reasonable' - e.g.
> that a column expecting a Date gets data that is in a Date format, etc.).
> I'm importing this data into a Firebird table.
> In order to be able to validate the text information in the file to
> I'd like to know the field types of each column in the table. The number
> elements per line in the text file matches exactly with the number of
> columns in the table.
> How can I query the Firebird database (this is in 1.5) and get back the
> column names and field types, so I can validate the text file for the
> import?

Take a look at RDB$FIELDS in combination with RDB$RELATION_FIELDS.

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
My thoughts:
Database development questions? Check the forum!