Friday, January 07, 2011

Get all the columns of a given table in Firebird database

Following sql script gives all the columns of a given table (‘Employee’ in this example) in a Firebird database.

SELECT Fields.RDB$FIELD_NAME "Column Name" FROM RDB$RELATION_FIELDS Fields
WHERE Fields.RDB$RELATION_NAME = 'EMPLOYEE' and Fields.RDB$SYSTEM_FLAG = 0
ORDER BY Fields.RDB$FIELD_POSITION

No comments: