Thank you for your response.
However, the PARTKEYSEQ in syscat.columns represents the distribution key of the table.
It seems that the range partition column information is not available in syscat.columns.
------------------------------
JH Kim
------------------------------
Original Message:
Sent: Mon June 12, 2023 03:16 AM
From: Joachim Müller
Subject: DB2LUW - How can I find the partition column of a range partitioned table?
Hello JH Kim,
I believe this is what you are looking for:
SELECT RTRIM(TABSCHEMA) AS TABSCHEMA, RTRIM(TABNAME) AS TABNAME, COLNAME, PARTKEYSEQ
FROM SYSCAT.COLUMNS
WHERE PARTKEYSEQ <> 0
AND TABSCHEMA NOT LIKE 'SYS%'
ORDER BY PARTKEYSEQ;
Best regards,
Joachim
------------------------------
Joachim Müller
Original Message:
Sent: Mon June 12, 2023 02:56 AM
From: JH Kim
Subject: DB2LUW - How can I find the partition column of a range partitioned table?
If store_id was used as the range partition table's column as shown below,
is there any way to find the partition column of the sales_fact_tp table in the catalog table without using db2look?
It seems that there is no such information in syscat.columns.
Can you please help me with this?
create table sales_fact_tp (
date_id date ,
product_id integer ,
store_id integer ,
quantity integer ,
price integer ,
transaction_details char(100) )
in data1 index in index1
partition by range(store_id)
(part part00 starting(minvalue) ending(50) in data1 index in index1,
part part0 starting(51) ending(100) in data1 index in index1,
part part1 starting(101) ending(150) in data1 index in index1,
part part2 starting(151) ending(200) in data1 index in index1,
part part3 starting(201) ending(250) in data1 index in index1)
------------------------------
JH Kim
------------------------------