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
 

 

What is the SQLCODE = -253 means?

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

Active User


Joined: 15 Dec 2005
Posts: 237

PostPosted: Mon May 24, 2010 11:32 am    Post subject: What is the SQLCODE = -253 means?
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

Site Director


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

PostPosted: Mon May 24, 2010 12:01 pm    Post subject:
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: 237

PostPosted: Mon May 24, 2010 1:17 pm    Post subject:
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    Post subject:
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: 237

PostPosted: Mon May 24, 2010 2:35 pm    Post subject:
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    Post subject:
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
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 DB2 SQL Error: SQLCODE=-440, SQLSTATE... kishpra DB2 1 Sat Feb 18, 2017 2:31 am
No new posts SQLCODE-000000080N priya91 DB2 1 Mon Feb 01, 2016 4:35 pm
No new posts Null Indicator value -2 means in Embe... deepak_shrivastava DB2 2 Wed Jan 06, 2016 10:27 pm
No new posts Need to understand SQLCODE = 12 rohanthengal DB2 3 Thu Nov 05, 2015 11:22 am
No new posts SQLCODE -922 in Batch-Cics program tr... kishpra CICS 2 Thu Sep 10, 2015 12:36 pm


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