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

What is the SQLCODE = -253 means?


IBM Mainframe Forums -> DB2
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Mon May 24, 2010 11:32 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon May 24, 2010 12:01 pm
Reply with quote

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
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Mon May 24, 2010 1:17 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon May 24, 2010 1:44 pm
Reply with quote

Hi Murali...

It also says....
Quote:

Use GET DIAGNOSTICS to obtain information about the error and warning conditions that occurred.
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Mon May 24, 2010 2:35 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon May 24, 2010 2:50 pm
Reply with quote

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
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Sun Jul 22, 2018 1:46 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sun Jul 22, 2018 2:35 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts SQLCODE = -122 while using the scalar... DB2 4
No new posts SQLCODE = -16002 when using XMLEXISTS DB2 1
No new posts Is SQLCODE -811 possible while fetchi... DB2 1
No new posts SQLCODE=-204 SQLSTATE=42704 DB2 4
No new posts Getting sqlcode 805 while executing R... DB2 10
Search our Forums:

Back to Top