depending if table partitioning or db partitioning has been used
go to : SYSCAT.PARTITIONMAPS catalog view
and see for partitioning key : in sycat.partitionmaps datapartitions.....
Best Regards, Guy Przytula
Database Software Consultant
Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
Information Server Datastage Certified http://www.infocura.be
db2 "select colname from syscat.columns where PARTKEYSEQ=1 and tabname='<TABLENAME>'"
That is not the partition key name, it might be an index or primary key. I ran this on a table where I know the partition column name, and it does not return the partitioned column name.
PARTKEYSEQ = The column's numerical position within the table's distribution key; 0 or the null value if the column is not in the distribution key. Null for columns of subtables and hierarchy tables.
To find the partitioned column name used -
-- identify column names used in partitions
,cast(datapartitionexpression as varchar(100)) part_column
where tabschema = 'SCHEMA_OWNER'
order by 1,2