Page 1 of 1

Datatypes and Length of Reject Codes (DBMSCODE,SQLSTATE,etc)

Posted: Wed Apr 19, 2006 3:55 pm
by zbethem
In defining the datatype and lengths of the reject columns, I'm at a loss as to what to define the values to.

I'm capturing the following in my reject link:
DBMSCODE
LASTERR
REJECT
REJECTCODE
SQLSTATE

Does it matter what I define these to? All my searches have come up empty as to what the datatypes of these codes are. Figured I'd ask the crowd.

Thanks in advance.

Posted: Wed Apr 19, 2006 4:02 pm
by diamondabhi
I use varchar with length 100.

Posted: Wed Apr 19, 2006 4:06 pm
by kcbland
If you're trapping to a sequential file, the datatypes are really irrelevant except for a few quirks. Choose a delimited file and just set the metadata to VARCHAR. Set the length and display to something you like because it affects the VIEW DATA display. If you choose fixed-width, you get into issues with the column size (really the display size) matters. Make it simple and just use a delimited file.

Posted: Wed Apr 19, 2006 4:47 pm
by ray.wurlod
VarChar is always safe. SQLSTATE is never more than 20 characters long, DBMSCODE never more than 10, and the REJECTED variables are true/false (1 or 0). However, depending on the database, LASTERR can be very long indeed; for any Microsoft data source I allow VarChar(4000) or even more, since they generate very verbose error/warning messages.