|
View previous topic :: View next topic
|
| Author |
Message |
Guest
|
|
|
|
Hi,
I am trying to insert a row into a DB2 table, i get a SQLCODE = 0 for the insert query yet the insert is not successful.Can someone help here as what could be the reasons for the same.
Thanks
Gk |
|
| Back to top |
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
How do you know the insert is not successful?
What are you using to do the insert, spufi or a user written program? |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
| Quote: |
| what could be the reasons for the same |
Something issued a ROLLBACK. . .?
As Craig asked - what are you using to do the insert? |
|
| Back to top |
|
 |
Guest
|
|
|
|
Hi,
I am using a program to insert into the table, how can i find if Roll back had been issued or not in this case
I had given a display statement after the execution of the query for finding the sql code and it returned 0
regards
gk |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Currently, after the insert, does the process abend? Is the problem insert in a called module?
As an experiment, put a COMMIT immediately after the INSERT. Then end the process. Then check if the row is in the table. |
|
| Back to top |
|
 |
Akatsukami
Global Moderator

Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
| gokuls wrote: |
Hi,
I am using a program to insert into the table, how can i find if Roll back had been issued or not in this case
I had given a display statement after the execution of the query for finding the sql code and it returned 0
regards
gk |
Is the program abending, or is it terminating normally (abeit with a non-zero completion code)? Are there explicit COMMIT and/or ROLLBACK statements in the program? |
|
| Back to top |
|
 |
bhairon singh rathore
New User

Joined: 19 Jun 2008 Posts: 91 Location: banglore
|
|
|
|
Hi Gokul
I think you need to check your program logic.
Please check sqlerrd(3) for number of rows affected. |
|
| Back to top |
|
 |
|
|