For example:> "SELECT TABLE_NAME as table_name, TYPE_NAME as data_type, REMARKS as column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'SYS_DICT'"
[DEBUG] 21:19:57.749 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = ?
| 1 |
|----------|
| SYS_DICT |
For example:> "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = 'SYS_DICT'"
[DEBUG] 21:19:57.750 org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:103) - SQLException
org.h2.jdbc.JdbcSQLException: Table "KEY_COLUMN_USAGE" not found; SQL statement:
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = ? [42102-196]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.schema.Schema.getTableOrView(Schema.java:456)
at org.h2.command.Parser.readTableOrView(Parser.java:5535)
at org.h2.command.Parser.readTableFilter(Parser.java:1266)
在h2网页执行 能正常执行
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME ='SYS_LOGININFOR';
COLUMN_NAME
ID
(1 行, 2 ms)
求大神指点