View Single Post

   
  #2 (permalink)  
Old 03-17-2008, 07:12 AM
Serge Rielau
 
Posts: n/a
Default Re: Questions about DB2 range partition

Challenge wrote:
> Hi,
>
> I have some questions about DB2 range parition and I cannot find the
> answer from the document.
>
> 1. Can I name the partition name for every partition in a range
> partition? For example, p2008jan for data of Jan, 2008?

Yes. The clause is PARTITION <partitionname> see CREATE TABLE.
>
> 2. Can I select data from a particular partition? Such as, select
> count(*) from <owner>.<table_name>.<partition1>

Absolutely not. And that is by design.
Partitioning is part of physical design it does not belong into SQL.
Use a range query to get the data you want.
The effect shoule be the same.

> 3. Which catalog tables provide information about range partition
> tables?

SYSCAT.DATAPARTITIONS, SYSCAT.DATAPARTITIONEXPRESSION

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Reply With Quote