Welcome Guest! Log in
×

Notice

The forum is in read only mode.
Due to some maintenance operations, stambia.org will be switched to read-only mode during the 13th November. It will be possible to read and download, but impossible to post on the forums or create new accounts. For any question please contact the support team.

Topic-icon Question Replicator rdbms character NUL not recognised

More
18 Oct 2016 16:56 #1 by MOUDEN_Kenza
MOUDEN_Kenza created the topic: Replicator rdbms character NUL not recognised
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
Thomas BLETON replied the 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
MOUDEN_Kenza replied the 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
Thomas BLETON replied the 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
MOUDEN_Kenza replied the 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
Thomas BLETON replied the 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
MOUDEN_Kenza replied the topic: Replicator rdbms character NUL not recognised
Okay
More
20 Oct 2016 16:28 #8 by MOUDEN_Kenza
MOUDEN_Kenza replied the topic: Replicator rdbms character NUL not recognised
Hello,
Thank you Thomas BLETON the script you gave me finally worked well.