473,699 Members | 2,838 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 13440
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
4547
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
10131
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
3232
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
2741
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
3389
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
2855
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
3829
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
2228
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
3710
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
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8905
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
8880
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
6532
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
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4373
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
4625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3053
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
2
2342
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.