Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用了查询
"DESCRIBE TABLE Mytable"
但它不起作用。然后我通过使用得到了 mytable 的结构
"Select distinct(name), ColType, Length, nulls, default from qsys2.SYSCOLUMNS where tbname = 'Mytable'"
它有效,但我将默认设置为是/否。如何获取每个字段的默认值
您可以通过 db2look 命令获取表的 DDL,然后检索每列的默认值(如果有)。
http://publib.boulder.ibm.com/infocenter/db2luw/v10r1/topic/com.ibm.db2.luw.admin.cmd.doc/doc/r0002051.html
db2look -d yourDB -e -tw Mytable% -o db2look.sql