Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am trying to write data from a .csv file to my postgreSQL database. The connection is fine, but when I run my job i get the following error:

Exception in component tPostgresqlOutput_1
org.postgresql.util.PSQLException: ERROR: zero-length delimited identifier at or near """"
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:336)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:328)
    at talend_test.exporttoexcel_0_1.exportToExcel.tFileInputDelimited_1Process(exportToExcel.java:568)
    at talend_test.exporttoexcel_0_1.exportToExcel.runJobInTOS(exportToExcel.java:1015)
    at talend_test.exporttoexcel_0_1.exportToExcel.main(exportToExcel.java:886)

My job is very simple: tFileInputDelimiter -> PostgreSQL_Output

I think that the error means that the double quotes should be single quotes ("" -> ''), but how can i edit this in Talend?

Or is it another reason? Can anyone help me on this one?

Thanks!

share|improve this question
1  
Please show us the SQL statement that is being executed –  a_horse_with_no_name Sep 30 '11 at 13:32
    
It rather looks like an empty column name, or a null value in a column to me. Would need to see the entire job, including the schemas for input and output. –  drmirror Sep 30 '11 at 15:40
    
I'm using the customer.csv file from the Talend tutorial. This I'm inserting into a new database with no tables or anything, and chose the option to create a new table if it doesn't exist. –  Tjekkles Oct 3 '11 at 6:39

1 Answer 1

up vote 3 down vote accepted

If you are using the customer.csv file from the repository then you have to change the properties of customer file by clicking through metadata->file delimited->customer in the repository pane.

You should be able to right click the customer file and then choose Edit file delimited. In the third screen, if the file extension is .csv then in Escape char settings you have to select CSV options. Typical escape sequences (as used by Excel and other programs) have escape char as "\"" and text enclosure is also "\"".

You should also check that encoding is set to UTF-8 in the file settings. You can then refresh your preview to view a sample of your file in a table format. If this matches your expectations of the data you should then be able to save the metadata entry and update this to your jobs.

If your file is not in the repository, then click on the component with your file and do all of the above CSV configuration steps in the basic settings of the component.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.