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

> 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
import,
> I'd like to know the field types of each column in the table. The number
of
> 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
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com