Developer forum

Forum » CMS - Standard features » Weird trimming of long description when importing from Excel

Weird trimming of long description when importing from Excel

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Guys,

I have a weird behavior with a data integration job.

I am trying to import data from an Excel file and everything seems fine except for the Long Description field that gets trimmed to 255 characters although the Field is defined as Nvarchar (Max).

In the Excel file, the description looks ok. No trimming.

Anyone had a similar issue before?

I am using 8.8.0.6.

Thanks,

Adrian


Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

I have tried using the CSV provider and it imported correctly.

Therefore the Source file and the Database definition are correct.

Looks like an Excel Provider bug.

Adrian

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Adrian,
maybe that can be connected to the job xml file?
Could you try to look in it and find the xml with your problematic column name and check the "limit" tag value?
It should be set to "-1" for the Nvarchar(max) instead of 255, should be like here:

<column type="Dynamicweb.DataIntegration.ProviderHelpers.SqlColumn" columnType="Dynamicweb.DataIntegration.ProviderHelpers.SqlColumn">
            <name>AccessCustomFieldValueKey</name>
            <type>System.String</type>
            <isNew>False</isNew>
            <limit>-1</limit>
            <isIdentity>False</isIdentity>
            <sqlDbType>NVarChar</sqlDbType>
            <isPrimaryKey>False</isPrimaryKey>
          </column>

Best reagrds, Dmitrij

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Thank you Dmitriy,

I cannot edit the job xml because it always ends up with an error.

Not sure why. I have tried editing with notepad, notepad ++ or the interbal DW editor. Always got the same outcome.

This means that even if the job xml is wrong, I cannot correct it.

I have checked in the file and this is what I have:

<column type="Dynamicweb.Data.Providers.SqlColumn" columnType="Dynamicweb.Data.Providers.SqlColumn">

<name>ProductLongDescription</name>

<type>System.String</type>

<isNew>False</isNew>

<limit>-1</limit>

<isIdentity>False</isIdentity>

<sqlDbType>NVarChar</sqlDbType>

<isPrimaryKey>False</isPrimaryKey>

</column>

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Adrian,

Try setting the encoding in the Save As dialog to UTF 8 when saving the file in Notepad or Notepad++

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Thank you Imar,

That will be useful for futher edits.

In my situation above, it looks like the job xml is not the issue as it looks like Dmitriy's suggestion already.

The only difference is the type of the column.

Adrian

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

HI Adrian,
your type is fine, mine is from Dynamicweb 9 version. This is a problem of Microsoft ACE.OLEDB driver which is used when reading data from Excel.
Seems it is a known problem with it, you could try the solutions for this from there:
https://forums.asp.net/t/1913118.aspx?Microsoft+oledb+data+acces+truncates+the+data+length+to+255+characters
http://stackoverflow.com/questions/24865183/data-truncated-after-255-bytes-while-using-microsoft-ace-oledb-12-0-provider
Regards, Dmitrij​

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Thank you Dmitriy,

That should probably solve it.

I will try it.

Thanks,

Adrian

 

You must be logged in to post in the forum