Character reference is an invalid XML character while importing data sources

wanpeng
Kilo Contributor

I created a Data sources using JDBC(Mysql).

While loading a table that included a LongBlog field,   there is a "Character reference "&#2" is an invalid XML character." error.

Other table without blob field can be imported as well.

Can some one help me......

By the way, the first row's Blog item is saved in [sys_attachment] table, but there is no data in ImportSet table.

May be something happend on creating relationship between [sys_attachment] table and ImportSet table.

1 ACCEPTED SOLUTION

Hi Liu,



There is a doc link here which mentions the sys_attachment table:


Mapping options


..


Mapping Binary or BLOB Fields


ServiceNow uses a special process to import binary and binary large object (BLOB) data from JDBC data sources. All binary data is automatically converted into a record in the Attachment [sys_attachment] table before the transformation occurs.


..


To have a transform map access the attachment, use the GlideRecord programming API in an onAfter script.


The script needs to run in an onAfterevent because the target.sys_id object is only available after the data is placed in the import set table. For example, to map the resulting attachment to the target transform record, you can use the following script.



Having said that I am uncertain if LongBlobs are supported - they can be up to 4GB in size - and I only see Blobs mentioned in the ServiceNow docs.


Best Regards



Tony


View solution in original post

5 REPLIES 5

tony_barratt
ServiceNow Employee
ServiceNow Employee

Hi Liu,



I think LongBlog is a typo - should be LongBlob?



Best Regards



Tony


Hi Tony


Yes, it is LongBlob.


sorry...


Hi Liu,



There is a doc link here which mentions the sys_attachment table:


Mapping options


..


Mapping Binary or BLOB Fields


ServiceNow uses a special process to import binary and binary large object (BLOB) data from JDBC data sources. All binary data is automatically converted into a record in the Attachment [sys_attachment] table before the transformation occurs.


..


To have a transform map access the attachment, use the GlideRecord programming API in an onAfter script.


The script needs to run in an onAfterevent because the target.sys_id object is only available after the data is placed in the import set table. For example, to map the resulting attachment to the target transform record, you can use the following script.



Having said that I am uncertain if LongBlobs are supported - they can be up to 4GB in size - and I only see Blobs mentioned in the ServiceNow docs.


Best Regards



Tony


Hi Tony


BLOB was imported correctly.


LongBlobs may be not supported.


thank you very much!