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
 

 

SQL Error -302

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

New User


Joined: 24 Jun 2006
Posts: 50

PostPosted: Tue May 03, 2011 5:19 pm    Post subject: SQL Error -302
Reply with quote

Hi,

I am getting a -302 DB2 error while trying to insert in a table.As searched from the internet its mentioned that the error could be due to one of the fields been inserted is bigger than the column.But the data is too huge to identify the column for which the data is being truncated.
Any suggestions how I can analyse the same.I am loading the data in the table through a file.
Back to top
View user's profile Send private message

Escapa

Senior Member


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

PostPosted: Tue May 03, 2011 6:33 pm    Post subject:
Reply with quote

How you are inserting records?

If it is through programming then verywell you can capture data where it is failing...

If it is any standard utility, What is your log saying


You can also use ICETOOL VERIFY operator to check numeric datatype of the data
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Tue May 03, 2011 6:49 pm    Post subject:
Reply with quote

if you are using a program, then trap the -302 with DSNTIAR
which will tell you the position number of the column..
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed May 04, 2011 3:25 pm    Post subject:
Reply with quote

I've not solved -302 personally, however, manuals says, emphasis added by me:
Quote:
-302 THE VALUE OF INPUT VARIABLE OR PARAMETER NUMBER position-number IS INVALID OR TOO LARGE FOR THE TARGET COLUMN OR THE TARGET VALUE

Explanation: DB2 received data that was invalid or too large to fit in the corresponding column of the table or the corresponding target value. The position-number identifies either the host variable number (if the message is issued as a result of an INSERT, UPDATE, DELETE, SELECT, VALUES INTO, or SET assignment statement), or the parameter number (if the message is issued as the result of a CALL statement or the invocation of a function).
So don't you get a "position-number" in the spool?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Wed May 04, 2011 3:41 pm    Post subject:
Reply with quote

Anuj Dhawan wrote:
So don't you get a "position-number" in the spool?


only if he display the SQLCA properly,
or uses DSNTIAR to expand the SQLCA to a message area, that can be displayed.

Only thing that gets displayed in SYSOUT is whatever the programmer deemed important enough to provide as debugging info.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 650
Location: Whitby, ON, Canada

PostPosted: Wed May 04, 2011 5:51 pm    Post subject:
Reply with quote

The SQLCA will also be available in the dump, assuming that the -302 caused an abend. Most (all?) modern dump formatting tools (such as Abendaid, Fault Analyzer, Dump Master) parse the SQLCA for you, and may even point out the host variable that caused the problem.
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 Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
No new posts INVOKE WEBSERVICE error danik56 CICS 11 Thu Mar 09, 2017 11:52 am


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