常用的四種數據庫類型如下:
Mysql database:
select column_name,column_type,column_comment from information_schema.COLUMNS where table_name = '表名' and table_schema = '數據庫名';
Oracle database:
select column_name, data_type from all_tab_columns where TABLE_NAME = '表名'
SQLServer database
select column_name,data_type from information_schema.columns where table_name = '表名'
Postgresql database
select column_name, data_type from information_schema.columns where table_name = '表名' ORDER BY ordinal_position;