문제

I need a stored procedure which in parameter have name of table(varchar) and it return names of columns in this specific table.

It is possible ? I think about some SELECT which retrieve this names from table but I am weak at SQL :/

I add that I use Firebird 1.5 :/

도움이 되었습니까?

해결책

You don't need stored procedure. Just a simple request can make this :

SELECT r.RDB$FIELD_NAME AS field_name
FROM RDB$RELATION_FIELDS r WHERE
r.RDB$RELATION_NAME='TABLE_NAME' --table name 
ORDER BY r.RDB$FIELD_POSITION;

you can learn more here : http://www.alberton.info/firebird_sql_meta_info.html

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top