By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,569 Members | 1,394 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,569 IT Pros & Developers. It's quick & easy.

Primary Key error wrong number of qualifiers

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.