Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
venkey2847
Contributor II
Contributor II

QVX-UNEXPECTED-END-OF-DATA

Hi All, 

When I am loading tables from sql server I am facing following error. 

QVX-UNEXPECTED-END-OF-DATA.

Tables having large volume of data. 

Please help me with the issue. 

Thanks in advance. 

Thanks 

Venkey.

4 Replies
Brett_Bleess
Former Employee
Former Employee

The best I can offer is a means to kick in some additional logging, but give me a few minutes to update the Article, as I noticed we did not post the paths to the files, which may make things a bit difficult to do.

https://support.qlik.com/articles/000040748 

Found another one:

https://support.qlik.com/articles/000005502 

I suspect this may actually be an issue in the OLE DB connector though, but the additional logging should help confirm that.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
QlikPYee
Contributor
Contributor

As there is no definitive answer to this ticket, I thought we would share our experience with this issue as it may be of help to others.  We are on Qlik Sense but as the issue is, we believe, elicited by the use of the SQL Server ODBC driver, it should be applicable to QlikView users as well.

We would encounter the following error intermittently in our loads on a weekly basis: QVX_UNEXPECTED_END_OF_DATA: SQL##f - SqlState: 01004, ErrorCode: 0, ErrorMsg: [Microsoft][ODBC Driver 13 for SQL Server]String data, right truncation

(Target instance was SQL Server 2012.)

After some research, we tracked the issue down to what seems to be the intermittent incorrect sizing (or the interpretation thereof) of NVARCHAR(MAX) columns by the ODBC driver.  It seems the description of the resultset returned does not always size these columns properly for its in-memory schema, and when the processing comes across a value which does not fit into the initially-defined column, a truncation error is encountered.

The solution to this is to CAST the returned NVARCHAR(MAX) columns to NVARCHAR(n) in the SQL portion of the load, where n is a specific value.  Our solution peers into the database first, to determine the max lengths of the necessary columns, Peeks them into variables in the load script, then inserts the values in CAST statements in the SQL load portion of the script.  Another less robust way to do this would be to set n to an arbitrarily high number (like CAST(column_name AS NVARCHAR(4000))), but this runs the risk of truncating values without any visibility, so it really depends on how well you know your data.

Since we've implemented this pattern, we have not seen this issue again in our loads against the target database.

alecjones-DAVEY
Contributor
Contributor

Could you possibly share an example code of how you accomplished this? I'm a newer developer in QS and we are facing this same error doing a big data load through ODBC. I'm trying to test out an OLEDB connection to see if that might fix it, but I'm interested in trying your solution if you're willing to share. Thank you

fabian3684386
Contributor III
Contributor III

I seem to encounter the same error for a Snowflake connector to Qlik Sense arbitrarily using SELECT * FROM table