on 2017 Feb 19 10:35 AM
Is there a way to return a list of Column names, data types and if they have default values what they are?
I can get the Column names like this...
select c.column_name
from systabcol c
key join systab t on t.table_id=c.table_id
where t.table_name='tablename'
... but it would be really useful to be able also return the data types and if they have a default value or not
UPDATE
Figured out I can get the Column Name, Type, Nullable and Primary Key with
DESCRIBE TableName
Just need to find a way to return the default value and I've cracked the job!
Thank you
SYSTABCOL."default"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, that's for (global) autoincrement defaults - which need not to be primary keys. Cf. that FAQ...
User | Count |
---|---|
71 | |
11 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.