Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
billimmer
Creator III
Creator III

How to write a zero length string (empty string) instead of null with tPostgresqlOutputBulk

I can't get this to work.  Even if I tmap the field to "", it still is written as null in postgresql.  The bulk file is created with nothing between the delimiters.  If I manually edit the bulk file to "" instead of blank, then I get a null string.  

 

The only thing I can think to do is to map a single space (" "), and then after writing the bulk file, using treplace to convert all " " to "".  

 

Is there anything better?  (Note the bulk file is created as csv)

 

Thanks!

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi
I have made a testing and I got the same issue, what we can do is to replace " " with "" after the bulk file is created, use tReplace as you did or use tFileInputRaw to read the whole file content as a string, replace all " " with "" and then create a new bulk file.
tFileInputRaw--main--tJavaRow--tFileOutputRaw.

on tJavaRow:
//Code generated according to input schema and output schema
output_row.content = (input_row.content).toString().replaceAll(" ","");

Regards
Shong

View solution in original post

2 Replies
Anonymous
Not applicable

Hi
I have made a testing and I got the same issue, what we can do is to replace " " with "" after the bulk file is created, use tReplace as you did or use tFileInputRaw to read the whole file content as a string, replace all " " with "" and then create a new bulk file.
tFileInputRaw--main--tJavaRow--tFileOutputRaw.

on tJavaRow:
//Code generated according to input schema and output schema
output_row.content = (input_row.content).toString().replaceAll(" ","");

Regards
Shong
billimmer
Creator III
Creator III
Author

Thank you for your very complete response.

 

It would be nice if there was an option in the OutputBulk component to do this.  Maybe in a future release of the component?

 

thanks!