473,847 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 13473
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...@mobile audio.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...@mobile audio.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=4260 1
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...@mobile audio.comwrote:
sachin wrote:
On Sep 21, 4:26 am, Ian <ianb...@mobile audio.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=426 01
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4558
by: Geoff Cayzer | last post by:
At http://www.blueclaw-db.com/tips_tricks.htm I came across a section which is included below and was hoping for some comment on the article. -------------- Almost never use this auto-number field as the primary key of the table. If you are thinking of hiring an Access programmer or consultant ask
14
10152
by: Abhi | last post by:
FYI: This message is for the benefit of MS Access Community. I found that this prblem has been encounterd by many but there is hardly any place where a complete solution is posted. So I thought I should give back to the community by posting our findings. Thanks you all for all your help till now by posting problems and their solutions. ~Abhijit
2
3238
by: stranger | last post by:
My database is set up so people can input parts orders. Sometimes they order the same parts on a monthly basis. I want to be able to duplicate past parts orders and have it pasted in with a new primary key. My first attempt seemed to work(minus a few Microsoft glitches). I used a "duplicate" command button at first. This made a copy of the record but failed to bump up the primary key by 1 number(so it seemed). Actually, the number did...
3
2744
by: Lotto | last post by:
Hello, i've looked in a lot of places but can't seem to find the answer, so I hope you can help me. I've made programmatically a table in an access database with keys. The foreign keys I can find (in the MSysObjects) but where can I find the primary keys??? I want to check whether the keys I have made are correct (when something goes wrong)
9
3396
by: Steven C. | last post by:
Hello: I'm getting an error, "primary key not defined" when trying to use the FIND method on the DataTable Rows collection. I have a typed dataset called 'MortgagesDS' that I created with the XSL builder tool in .NET. I define the dataset at the beginning the the main class: MortgageDS _MortgageDS = new MortgageDS();
33
2881
by: Martin Jørgensen | last post by:
Hi, In continuation of the thread I made "perhaps a stack problem? Long calculations - strange error?", I think I now got a "stable" error, meaning that the error always seem to come here now (tried: visual studio 2005 + linux/macintosh gcc)... That's a pretty good thing. I think the error still appears using both gcc and visual studio 2005. Everything is standard C (ANSI C ?? I don't know the difference) - but since so many functions...
4
3838
by: Peter | last post by:
I am interested in informed feedback on the use of Constraints, Primary Keys and Unique. The following SQL statement creates a Bands tables for a database of bookings Bands into Venues, where the rule of the business is that only band plays on the one night. The SQL statement prevents a Band name being repeated (as it is Unique). Similar statement for the Venues. CREATE TABLE Bands (BandID varchar(5) CONSTRAINT BandID PRIMARY KEY, Band...
4
2234
by: lovecreatesbea... | last post by:
Gcc only gives out a warning: `assignment discards qualifiers from pointer target type' against code such as following: $ type a.c int main(void) { const char *pc; char *p = pc;
21
3733
by: MNNovice | last post by:
I am getting error message while entering data using a sub form. Here are the details of the tables associated with this form. Basically I am trying to enter expense data. tblECHO has these fields ECHOID – Pk (auto) EchoNo – Text SubmitDate – Date/Time ReceiveDt – Date/ Time tblMTAP MTAPID – PK (auto)
0
9882
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9727
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10982
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10706
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10335
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7880
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5719
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5909
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4524
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.