× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I was running in debug for other reasons and I saw SQL7919 reason code 5
in the job log. The indicated column in error was CITY. In my case, it
was SELECT ... COALESCE(CITY, ' ') FROM a whopping load of LEFT JOINs.
The ellipsis indicates about 40 columns omitted for clarity.

SQL7919 rc5 indicates that the incoming data is VARCHAR but the
destination variable is CHAR. There are no VARCHAR columns in any of
the tables in this SQL statement, and none as the target of the FETCH
INTO. After a fruitless search of the Knowledge Center, I decided to
brute force it for the moment and did SELECT CAST(COALESCE(CITY, ' ') as
CHAR(30). Now CITY was OK, but STATE was throwing the SQL7919 rc5.

Clearly something wasn't right. After some more manual / forum / email
searches, I assumed that the SQL7919 was bogus, gave up and went for
another brute force solution. One by one I started taking columns out
of the cursor and fetch until it ran without error.

It turns out it was a size mis-match - and SQLSTATE was 01004 the whole
time. I should have trusted the SQLSTATE from the beginning, although
there is virtually no hint from the database as to WHICH columns are
being truncated.

Bottom line: Trust SQLSTATE. Don't trust the messages issued in debug
mode.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.