Welcome Guest! Log in
×

Notice

The forum is in read only mode.
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…

Topic-icon Question Replicator rdbms character NUL not recognised

More
18 Oct 2016 16:56 #1 by MOUDEN_Kenza
Replicator rdbms character NUL not recognised was created by MOUDEN_Kenza
Hello,
I have a .txt file that contains the character NUL => \0 (see in attechements).
And when using the replicator rdbms it gave me the error below.
Attachments:
More
19 Oct 2016 10:42 #2 by Thomas BLETON
Replied by Thomas BLETON on topic Replicator rdbms character NUL not recognised
Hi,
Apparently the message is raised by Postgresql, UTF-8 does not like NUL chars.
What is your question? You want to ignore these characters? Or you want to integrate them into your Postgresql db?
More
19 Oct 2016 11:00 #3 by MOUDEN_Kenza
Replied by MOUDEN_Kenza on topic Replicator rdbms character NUL not recognised
Hi,
Yes, my question is how to ignore those characters?
More
19 Oct 2016 11:23 - 19 Oct 2016 11:24 #4 by Thomas BLETON
Replied by Thomas BLETON on topic Replicator rdbms character NUL not recognised
I would add a "Transformation Line" scripting in the file's Metadata for replacing every NUL char with an empty string ''.
- In the File's properties, go into the Transformation tab
- Add this Script in the Line section:
__string__.replace(/\0/g, '');
- Set the Language to: rhino

=> make sure your mapping is using Load File to Rdbms (not the Postgres with Copy), so that Stambia's File Driver is used and applies the above script.

Note: the above solution works well but as always, undesired characters should be removed at the data source - if possible.
Last edit: 19 Oct 2016 11:24 by Thomas BLETON.
More
19 Oct 2016 12:08 #5 by MOUDEN_Kenza
Replied by MOUDEN_Kenza on topic Replicator rdbms character NUL not recognised
Hi,
Thank you my replicator run whithout an error but it didn't insert any line, so I went to consult the data of my file in the metadata and then I got the error :NullPointerexception:null

Note: I'm using just a replicator in a process, there is no mapping in it.
Attachments:
More
19 Oct 2016 12:25 #6 by Thomas BLETON
Replied by Thomas BLETON on topic Replicator rdbms character NUL not recognised
Can you share an Export models and dependencies of the process + the sample data file?
You can send these elements in a support ticket if you prefer.
More
19 Oct 2016 13:36 #7 by MOUDEN_Kenza
Replied by MOUDEN_Kenza on topic Replicator rdbms character NUL not recognised
Okay
More
20 Oct 2016 16:28 #8 by MOUDEN_Kenza
Replied by MOUDEN_Kenza on topic Replicator rdbms character NUL not recognised
Hello,
Thank you Thomas BLETON the script you gave me finally worked well.