multiline string is not properly quoted - tDBOutput

Highlighted
Five Stars

multiline string is not properly quoted - tDBOutput

I put a standart tDBOutput component in the Talend Job, setup a table schema, and Talend Job become broken / can't compile, with the following error message: String literal is not properly closed by a double-quote

Compilation error caused by improperly formatted string literal. Talend generated source code for insert_tDBOutput_1 string initialisation as a multiline string, inserted a "new line" character, but have not appropriate double quoted this line break. I suppose, Java 1.8 compiler can not understand this syntax yet.

 

                String insert_tDBOutput_1 = "INSERT INTO " + tableName_tDBOutput_1 + " (address,addresstype,parentaddresscode,name1,name2,name3,address1,address2,contact,zipcode,city,state,country,blacklist,blacklistsince,blacklisttext,deliverycond,shipmentcond,paymentcond,currency,returngoods
via,resourcetype,billcond,billtext) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";    

I can't remove fields to minimize the string length and fit it into a single line, as I need all this fields into database table.
Please, is it possible to tune a Eclipse, or Talend environment - to tell code generator - do not break the strings into several lines?

The problem, may be, with the Talend Component Java Emitter Templates (JET) files for Oracle DB output?

 


Accepted Solutions
Forteen Stars

Re: multiline string is not properly quoted - tDBOutput

@esafonov ,the problematic column form the schema is returngoodsvia ? are you going to create a new table? please mention the output column as returngoods_via.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

All Replies
Forteen Stars

Re: multiline string is not properly quoted - tDBOutput

@esafonov,can you check the below link may help.Could you also show the settings in tOracleOutput component.

https://community.talend.com/t5/Design-and-Development/Getting-error-quot-String-literal-is-not-prop...

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Five Stars

Re: multiline string is not properly quoted - tDBOutput

Thank you, @manodwhb, I checked this tread, it flagged as "Resolved", it's by my colleague, but actually does not provide the solution.
Forteen Stars

Re: multiline string is not properly quoted - tDBOutput

@esafonov ,you need to check the schema for tDBOutput.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Five Stars

Re: multiline string is not properly quoted - tDBOutput

The schema is quite simple, and correct
schema dboutput.jpg

Forteen Stars

Re: multiline string is not properly quoted - tDBOutput

@esafonov ,the problematic column form the schema is returngoodsvia ? are you going to create a new table? please mention the output column as returngoods_via.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Five Stars

Re: multiline string is not properly quoted - tDBOutput

Amazing, @manodwhb ! 
I was able to succeed because of your advice Heart
Yes, i'm trying to drop (if exists) and create the table, and I changed the output database column name from returngoods_via to returngoods, and now Talend generates correct Java source code.
(Now it keeps the line solid, not inserting unpredicted new line break in the middle of SQL query string).
So, this underscore does really matters.

If you're going to visit Yekaterinburg / Russia - just drop me a line, how about letting me offer you a cup of coffee?

 

talend multile line string is not double quoted resolved.jpg

 

Forteen Stars

Re: multiline string is not properly quoted - tDBOutput

Hi @esafonov ,Thank  you for your offer ,sure,as of now i do not have any plan Smiley Happy . I am from India.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog