469,306 Members | 1,881 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

Primary Key error wrong number of qualifiers

Hi,
I am facing some strange issue in DB2 UDB 9.5.1

I have created a database on DPF implemented environment and I tried
to execute following commands

Db2 create table test ( name char(10) not null, acno integer not
null );
Completed successfuly

Db2 alter table test add constraint PK_test primary key ( acno );
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0108N The name "PK_TEST" has the wrong number of qualifiers.
SQLSTATE=42601

But if I create primary key on first column ( Db2 alter table test add
constraint PK_test primary key ( name ))
it works fine. I am not sure whether it is related to DPF or Db2
version.

Please help.

Regards
Sachin Shinde

Sep 20 '08 #1
6 12162
sachin wrote:
Hi,
I am facing some strange issue in DB2 UDB 9.5.1

I have created a database on DPF implemented environment and I tried
to execute following commands

Db2 create table test ( name char(10) not null, acno integer not
null );
Completed successfuly

Db2 alter table test add constraint PK_test primary key ( acno );
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0108N The name "PK_TEST" has the wrong number of qualifiers.
SQLSTATE=42601

But if I create primary key on first column ( Db2 alter table test add
constraint PK_test primary key ( name ))
it works fine. I am not sure whether it is related to DPF or Db2
version.
Is this the exact statement or have you sanitized it?
This error is raised if you give a "one part name" a "dot".
Your _example_ looks sound.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Sep 20 '08 #2
On Sep 20, 6:06*pm, Serge Rielau <srie...@ca.ibm.comwrote:
sachin wrote:
Hi,
I am facing some strange issue in DB2 UDB 9.5.1
I have created a database on DPF implemented environment and I tried
to execute following commands
Db2 create table test ( name char(10) not null, acno integer not
null );
Completed successfuly
Db2 alter table test add constraint PK_test primary key ( acno );
DB21034E *The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. *During SQL processing it
returned:
SQL0108N *The name "PK_TEST" has the wrong number of qualifiers.
SQLSTATE=42601
But if I create primary key on first column ( Db2 alter table test add
constraint PK_test primary key ( name ))
it works fine. I am not sure whether it is related to DPF or Db2
version.

Is this the exact statement or have you sanitized it?
This error is raised if you give a "one part name" a "dot".
Your _example_ looks sound.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab- Hide quoted text -

- Show quoted text -
Hi
It's complete error...I am also facing another related issue also... i
think it's related to this only...
i am not able to create 2 unique indexes on this. Facing following
error

DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0270N Function not supported (Reason code = "1"). SQLSTATE=42997

i could create the same on non DPF database which is on windows and
DPF database is on linux.

regards
sachin shinde

Sep 20 '08 #3
Ian
sachin wrote:
Hi,
I am facing some strange issue in DB2 UDB 9.5.1

I have created a database on DPF implemented environment and I tried
to execute following commands

Db2 create table test ( name char(10) not null, acno integer not
null );
Completed successfuly

Db2 alter table test add constraint PK_test primary key ( acno );
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0108N The name "PK_TEST" has the wrong number of qualifiers.
SQLSTATE=42601

But if I create primary key on first column ( Db2 alter table test add
constraint PK_test primary key ( name ))
it works fine. I am not sure whether it is related to DPF or Db2
version.
This is DPF.

I suggest you read the documentation about the requirements for
partitioning keys and their relationship to unique indexes (i.e. primary
key or other unique keys).

While you're at it, read up on how DB2 selects a partitioning key if you
don't specify one explicitly.
In short: Unique indexes must include all column(s) used as the
partitioning key. The partitioning key may be a subset of the columns
in the unique index.
Sep 20 '08 #4
On Sep 21, 4:26*am, Ian <ianb...@mobileaudio.comwrote:
sachin wrote:
Hi,
I am facing some strange issue in DB2 UDB 9.5.1
I have created a database on DPF implemented environment and I tried
to execute following commands
Db2 create table test ( name char(10) not null, acno integer not
null );
Completed successfuly
Db2 alter table test add constraint PK_test primary key ( acno );
DB21034E *The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. *During SQL processing it
returned:
SQL0108N *The name "PK_TEST" has the wrong number of qualifiers.
SQLSTATE=42601
But if I create primary key on first column ( Db2 alter table test add
constraint PK_test primary key ( name ))
it works fine. I am not sure whether it is related to DPF or Db2
version.

This is DPF.

I suggest you read the documentation about the requirements for
partitioning keys and their relationship to unique indexes (i.e. primary
key or other unique keys).

While you're at it, read up on how DB2 selects a partitioning key if you
don't specify one explicitly.

In short: *Unique indexes must include all column(s) used as the
partitioning key. *The partitioning key may be a subset of the columns
in the unique index.- Hide quoted text -

- Show quoted text -
Hi

Unique index key on partitioned table should include columns used for
partitioning. But in my above example i am not creating partitioned
table also. It's normal table only. only implementation done is
database partitioning on instance level.

Regards
Sachin Shinde

Sep 22 '08 #5
Ian
sachin wrote:
On Sep 21, 4:26 am, Ian <ianb...@mobileaudio.comwrote:
>sachin wrote:
>>Hi,
I am facing some strange issue in DB2 UDB 9.5.1
I have created a database on DPF implemented environment and I tried
to execute following commands
Db2 create table test ( name char(10) not null, acno integer not
null );
Completed successfuly
Db2 alter table test add constraint PK_test primary key ( acno );
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0108N The name "PK_TEST" has the wrong number of qualifiers.
SQLSTATE=42601
But if I create primary key on first column ( Db2 alter table test add
constraint PK_test primary key ( name ))
it works fine. I am not sure whether it is related to DPF or Db2
version.
This is DPF.

I suggest you read the documentation about the requirements for
partitioning keys and their relationship to unique indexes (i.e. primary
key or other unique keys).

While you're at it, read up on how DB2 selects a partitioning key if you
don't specify one explicitly.

In short: Unique indexes must include all column(s) used as the
partitioning key. The partitioning key may be a subset of the columns
in the unique index.- Hide quoted text -

- Show quoted text -

Hi

Unique index key on partitioned table should include columns used for
partitioning. But in my above example i am not creating partitioned
table also. It's normal table only. only implementation done is
database partitioning on instance level.
It sounds like you don't understand what database partitioning is. I
recommend you read the manuals or other articles so you understand
what exactly DPF is. Here is an introductory article:

http://www.ibm.com/developerworks/db...ins/index.html
Note, DPF is not the same thing as range partitioned tables.

Sep 23 '08 #6
On Sep 23, 9:17*am, Ian <ianb...@mobileaudio.comwrote:
sachin wrote:
On Sep 21, 4:26 am, Ian <ianb...@mobileaudio.comwrote:
sachin wrote:
Hi,
I am facing some strange issue in DB2 UDB 9.5.1
I have created a database on DPF implemented environment and I tried
to execute following commands
Db2 create table test ( name char(10) not null, acno integer not
null );
Completed successfuly
Db2 alter table test add constraint PK_test primary key ( acno );
DB21034E *The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. *During SQL processing it
returned:
SQL0108N *The name "PK_TEST" has the wrong number of qualifiers.
SQLSTATE=42601
But if I create primary key on first column ( Db2 alter table test add
constraint PK_test primary key ( name ))
it works fine. I am not sure whether it is related to DPF or Db2
version.
This is DPF.
I suggest you read the documentation about the requirements for
partitioning keys and their relationship to unique indexes (i.e. primary
key or other unique keys).
While you're at it, read up on how DB2 selects a partitioning key if you
don't specify one explicitly.
In short: *Unique indexes must include all column(s) used as the
partitioning key. *The partitioning key may be a subset of the columns
in the unique index.- Hide quoted text -
- Show quoted text -
Hi
Unique index key on partitioned table should include columns used for
partitioning. But in my above example i am not creating partitioned
table also. It's normal table only. only implementation done is
database partitioning on instance level.

It sounds like you don't understand what database partitioning is. *I
recommend you read the manuals or other articles so you understand
what exactly DPF is. *Here is an introductory article:

http://www.ibm.com/developerworks/db...le/dm-0405wilk...

Note, DPF is not the same thing as range partitioned tables.- Hide quotedtext -

- Show quoted text -
Hi,

Thanks for reply.

I got the problem. I never considered that DB2 distributing every row
in the table by default without mentioning the distribute by clause.
If we don't mention the same while creating the table, it does select
by it's own which we may not use as subset in primary key OR unique
index.
In DPF environment, wee should always use distribute by clause to
avoid this kind of issues.

Thanks once again.

Regards
Sachin Shinde
Sep 23 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Geoff Cayzer | last post: by
3 posts views Thread by Lotto | last post: by
9 posts views Thread by Steven C. | last post: by
33 posts views Thread by Martin Jørgensen | last post: by
4 posts views Thread by Peter | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.