Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
esafonov
Contributor
Contributor

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?

 

Labels (3)
1 Solution

Accepted Solutions
manodwhb
Champion II
Champion II

@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.

View solution in original post

7 Replies
manodwhb
Champion II
Champion II

@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...

esafonov
Contributor
Contributor
Author

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

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

esafonov
Contributor
Contributor
Author

The schema is quite simple, and correct
0683p000009M3y7.jpg

manodwhb
Champion II
Champion II

@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.

esafonov
Contributor
Contributor
Author

Amazing, @manodwhb ! 
I was able to succeed because of your advice 0683p000009MApk.png
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?

 

0683p000009M3yM.jpg

 

manodwhb
Champion II
Champion II

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