Pradeep,
If I am correctly interpreting the the syntax diagram in the online documentation (
FRAGMENT BY clause ) them I should also be able to use "PARTITION BY LIST", as they are described as being equivalent:
FRAGMENT BY clause for tables
|--+-------------+--+-FRAGMENT -+--BY--------------------------->
'-WITH ROWIDS-' '-PARTITION '
.-,-------.
V |
>--+-ROUND ROBIN--+-IN----dbspace-+-----------------------+------+--|
| | .-,---------------------------------. | |
| | V | | |
| '---PARTITION--partition--IN--dbspace-+-' |
| (1) |
+-EXPRESSION--| Expression Fragment Clause |------------------+
| (2) |
+-RANGE--(--fragment_key--)--| Interval Fragment Clause |-----+
| (3) |
'-LIST--(--fragment_key--)--| List Fragment Clause |----------'
------------------------------
Luis Marques
------------------------------
Original Message:
Sent: Wed July 03, 2019 03:34 PM
From: Pradeep Natarajan
Subject: FRAGMENT BY LIST syntax error
Luis,
I am not sure I understand what correction in the documentation (or the parser) you are recommending. As shown in the documentation and in your (and Art's) modified SQL statement, when you use "FRAGMENT BY" clause it is working fine.
Is there something else you feel missing in the documentation?
------------------------------
Pradeep Natarajan Head of Engineering - Informix
Original Message:
Sent: Tue July 02, 2019 09:42 AM
From: Luis Marques
Subject: FRAGMENT BY LIST syntax error
Using Informix 14.10FC1 I am trying to create a table partitioned by LIST, as described in the documentation:
FRAGMENT BY clause
List fragment clause
CREATE TABLE dummy
(
id INT,
val CHAR(2)
)
PARTITION BY LIST ( val )
PARTITION dummy01 VALUES ( 'A' ) IN dbs1,
PARTITION dummy02 VALUES ( 'B' ) IN dbs2
;
This simple example is returning:
201: A syntax error has occurred.
Can someone provide a working example ? I keep reading the documentation, but I am not seeing what is the mistake I am making in this DDL.
EDIT:
Followed Fernando sugestion, and using FRAGMENT works ( I was too fixated on using the PARTITION keyword ).
CREATE TABLE dummy
(
id INT,
val CHAR(2)
)
FRAGMENT BY LIST ( val )
PARTITION dummy01 VALUES ( 'A' ) IN dbs1,
PARTITION dummy02 VALUES ( 'B' ) IN dbs2
;
However, it does seem that either the documentation or the Informix syntax parser needs to be corrected.
------------------------------
Luis Marques
------------------------------
#Informix