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

SQL Error -302


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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: 6966
Location: porcelain throne

PostPosted: Tue May 03, 2011 6:49 pm
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

Superior Member


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

PostPosted: Wed May 04, 2011 3:25 pm
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: 6966
Location: porcelain throne

PostPosted: Wed May 04, 2011 3:41 pm
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: 765
Location: Whitby, ON, Canada

PostPosted: Wed May 04, 2011 5:51 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Getting Error while trying to establi... DB2 3
Search our Forums:

Back to Top