Hi,
If any SQL error occured during run of any batch program, where can we check complete message for that SQL code. What I am asking is that is there a place in logs where it will give position of column where problem is, is there any variable which stores such message?
Description of SQL error.
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Description of SQL error.
Unless 'am mistaken you are looking for DSNTIAR. DSNTIAR is an assembler subroutine and helps you to obtain a formatted form of the SQLCA and a text message that is based on the SQLCODE field of the SQLCA. Said that, I've presumed you are using SQLCA in your COBOL-DB2 code. A typical output from DSNTIAR will look like this:
Hope this helps.
Code: Select all
DSNT408I SQLCODE = -501, ERROR: THE CURSOR IDENTIFIED IN A FETCH OR
CLOSE STATEMENT IS NOT OPEN
DSNT418I SQLSTATE = 24501 SQLSTATE RETURN CODE
DSNT415I SQLERRP = DSNXERT SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD = -315 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION
DSNT416I SQLERRD = X'FFFFFEC5' X'00000000' X'00000000'
X'FFFFFFFF' X'00000000' X'00000000' SQL DIAGNOSTIC
INFORMATION
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Re: Description of SQL error.
Thanks Anuj. Can you please help with some good example of it which I can use as a reference please?
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Description of SQL error.
A google search could have also helped you: A scenario for using DSNTIAR.
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Re: Description of SQL error.
Thank you so much Anuj.
Google helps more the experinced people like you
Google helps more the experinced people like you
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute