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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Can't Map a String into a Postgres Inet datatype

I need to migrate a string field from a mysql table (string type) to a Postgres inet type field. The tPostgresqlOutput is reading the type as object and choking on insert.
I tried to drop a constant into the right side of the Tmap, but that didn't work either. Tested it using direct SQL and it worked fine.
How do I format a string for use as something the Talend thinks is an Object type field? or how to i tell Talend to treat it like a string?
Here's a script to test it:
create table inet_test1 (id int, phone varchar(20), Ip_address varchar(20));
create table inet_test2 (id int, phone varchar(20), Ip_address inet);
insert into inet_test1 values (1, 'Phone1', '192.168.0.10');
insert into inet_test1 values (2, 'Phone2', null);
insert into inet_test1 values (3, 'Phone3', '192.168.0.30');

tPostgresqlInput -> tMap ( map all fields) -> tPostgresqlOutput
(I did the if null check on the mapping too)
Run...
Boom! no workee.
Labels (2)
4 Replies
Anonymous
Not applicable
Author

still baffled
Anonymous
Not applicable
Author

Hi,
Could you please upload your component schema setting screenshots into forum so that we can get your situation more precisely.
Do you want to convert the object to a plain string?If so, please have a look at https://community.talend.com/t5/Design-and-Development/How-to-select-Huge-CLOB-and-write-it-in-flat-...
Best regards
Sabrina
Anonymous
Not applicable
Author

Not sure what else is needed...
Anonymous
Not applicable
Author

Hi,
Have you checked Windows-->Preference-->Talend-->Metadata of TalendType and see mapping_Postgres.xml to define the schema correspond with the table in DB.(About the data type mapping between Talend type and db type)?
Best regards
Sabrina