Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Unable to Insert Duplicate Value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 85
Location: Bangalore

PostPosted: Fri Feb 09, 2007 6:43 pm    Post subject: Unable to Insert Duplicate Value
Reply with quote

I have a column which is not a primary key.

I try to insert a duplicate value in it, but I am not able to insert and neither do I get any errors.

Say there are 100 with 95 records having common values.
Only 6 records are inserted and others are not not inserted and neither do they give error.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Feb 09, 2007 6:49 pm    Post subject:
Reply with quote

What does your insert look like?
What does the table look like?
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 85
Location: Bangalore

PostPosted: Fri Feb 09, 2007 6:54 pm    Post subject:
Reply with quote

Its like
Insert into table1 values
(:value1,:value2,NULL,:value4)

My table has four columns
value1 - already has duplicate values
value2 - date
value3 - no
value4 - amount

I try to insert:
12345,'2006-09-09',Null,'45.98'
12345,'2006-09-09',Null,'25.18'
12345,'2006-09-09',Null,'65.28'
66666,'2006-09-09',Null,'85.48'
12345,'2006-09-09',Null,'95.58'
77777,'2006-09-09',Null,'45.68'

it inserts value:
12345,'2006-09-09',Null,'45.98'
66666,'2006-09-09',Null,'85.48'
77777,'2006-09-09',Null,'45.68'

For others it does not show error
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Feb 09, 2007 7:19 pm    Post subject:
Reply with quote

Are you inserting into a VIEW?
Could a stored procedure or user-defined function be in play?
Did you check the value of SQLERRD(3) in the SQLCA?
How are confirming that the other rows were not inserted, selecting from a VIEW?
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 85
Location: Bangalore

PostPosted: Fri Feb 09, 2007 8:05 pm    Post subject:
Reply with quote

I am not using a VIEW. Its a table...
I am not using stored procedures neither do I get any sql errors..

When I use spufi to check the table I donot find the rows inserted in it.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Feb 09, 2007 8:16 pm    Post subject:
Reply with quote

Aside from the fact that a VIEW looks like a table and acts like a table but may not select like a table, I don't know what to say.... icon_confused.gif
BTW, how would you confirm that it is a table and not a view?
Back to top
View user's profile Send private message
Suryanarayana.tadala

New User


Joined: 03 Nov 2005
Posts: 43
Location: St.Louis

PostPosted: Fri Feb 09, 2007 10:03 pm    Post subject:
Reply with quote

Could you tell me if any indexes are built on this table or can u provide me the DDL of the table in case if possible
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Feb 09, 2007 10:37 pm    Post subject:
Reply with quote

Hello,

Try to insert a duplicate row in spufi and post the insert and the result here.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts I am unable to use SWAPBAR ON command... mrsidhu12 TSO/ISPF 3 Thu Sep 01, 2016 1:10 pm
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us