View previous topic :: View next topic
|
Author |
Message |
pkmurali Warnings : 1 Active User
Joined: 15 Dec 2005 Posts: 271
|
|
|
|
Hi all,
I am getting SQLCODE=-253. I have searched for sqlcode=-253 in google not able to find the exact reason for this error. Please explain.
Thanks,
Murali. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
As you know, there is a link to "IBM Manuals" at the top of the page. From there look in the DB2/UDB Messages & Codes. |
|
Back to top |
|
|
pkmurali Warnings : 1 Active User
Joined: 15 Dec 2005 Posts: 271
|
|
|
|
Thanks Dick. I am getting -253 SQLCODE while inserting a table using multi row insert. The SQLCODE =-253 means
Quote: |
A NON-ATOMIC statement STATEMENT SUCCESSFULLY COMPLETED FOR SOME OF THE REQUESTED ROWS, POSSIBLY WITH WARNINGS, AND ONE OR MORE ERRORS |
I have used non-atomic with my insert SQL. I want to know what is the exact error happened like duplicate error(-803) or -180(timestamp format) for the particular row. Is it possible to get the exact sqlcode for the particular row while using multi row insert?
Thanks,
Murali. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Hi Murali...
It also says....
Quote: |
Use GET DIAGNOSTICS to obtain information about the error and warning conditions that occurred.
|
|
|
Back to top |
|
|
pkmurali Warnings : 1 Active User
Joined: 15 Dec 2005 Posts: 271
|
|
|
|
Sambhaji,
In GET Diagonistics what is the function which will give me the SQLCODE of the particular row?
NATIVE_ERROR is not working.
Constraint_Name is not working. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Code: |
EXEC SQL BEGIN DECLARE SECTION;
long row_count, num_condns, i;
long ret_sqlcode, row_num;
char ret_sqlstate[6];
...
EXEC SQL END DECLARE SECTION;
...
EXEC SQL
INSERT INTO DSN8810.ACT
(ACTNO, ACTKWD, ACTDESC)
VALUES (:hva1, :hva2, :hva3)
FOR 10 ROWS
NOT ATOMIC CONTINUE ON SQLEXCEPTION;
EXEC SQL GET DIAGNOSTICS
:row_count = ROW_COUNT, :num_condns = NUMBER;
printf("Number of rows inserted = %d\n", row_count);
for (i=1; i<=num_condns; i++) {
EXEC SQL GET DIAGNOSTICS CONDITION :i
:ret_sqlcode = DB2_RETURNED_SQLCODE,
:ret_sqlstate = RETURNED_SQLSTATE,
:row_num = DB2_ROW_NUMBER;
printf("SQLCODE = %d, SQLSTATE = %s, ROW NUMBER = %d\n",
ret_sqlcode, ret_sqlstate, row_num);
}
|
Simulate above for cobol... |
|
Back to top |
|
|
pkmurali Warnings : 1 Active User
Joined: 15 Dec 2005 Posts: 271
|
|
|
|
I have used the get diagnostics condition for multi row insert not sure why it is not giving -180 if any one of the row is having date format problem. I am getting -253 after executing diagnostics condition getting duplicate error message and sqlcode 80L (-803) . I checked whether it is duplicate but it's not. Please clarify.
Ex
2018-21-12 x y |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
You ARE joking are you not? EIGHT YEARS after the original topic was posted you are requesting clarification! I suspect that you do not have the original problem (surely that was resolved 8 years ago?) but a new one. New problem, new topic. Locked. |
|
Back to top |
|
|
|