IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Unable to Insert Duplicate Value


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Fri Feb 09, 2007 6:43 pm
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: 3156
Location: Tucson AZ

PostPosted: Fri Feb 09, 2007 6:49 pm
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: 83
Location: Bangalore

PostPosted: Fri Feb 09, 2007 6:54 pm
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: 3156
Location: Tucson AZ

PostPosted: Fri Feb 09, 2007 7:19 pm
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: 83
Location: Bangalore

PostPosted: Fri Feb 09, 2007 8:05 pm
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: 3156
Location: Tucson AZ

PostPosted: Fri Feb 09, 2007 8:16 pm
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
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

Moderator Emeritus


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

PostPosted: Fri Feb 09, 2007 10:37 pm
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 All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To Discard record with 0 entry if Dup... SYNCSORT 7
No new posts Sort to insert record in an empty file. DFSORT/ICETOOL 5
No new posts Unable to interpret a hex value to De... COBOL Programming 7
No new posts batch SFTP job using AOPBATCH unable ... All Other Mainframe Topics 7
No new posts Duplicate transid's declared using CEDA CICS 3
Search our Forums:


Back to Top