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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Issue using tPostgresqlOutput to create a table with big decimal : NUMERIC,0

Hi,

 

I tried with different versions of TOS DI (6.4.1, 6.4.0, 6.3.2, 6.2.1) but the code generated to create a table when choosing "Drop table if exists then create it" is always :

 

...\"Article\" INT4 ,\"Annee_2014\" NUMERIC,0 ,\"Annee_2015\" NUMERIC,0...

 

A Big Decimal is casted in a NUMERIC DB type field but with a 0 behind (default value? precision?). This SQL statement retrieve a "org.postgresql.util.PSQLException: ERROR: syntax error at or near "0"" at each time.

 

According to PostgreSQL manuals, a NUMERIC field may have a precision or a scale but between brackets, not a coma :

https://www.postgresql.org/docs/9.6/static/datatype-numeric.html

 

I use Talend with the tPostgresqlOutput and PostgreSQL for a while.... I don't understand...

Any clue please?

 

0683p000009LrKM.png

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi
You need to specify the length and precision of column on the schema if you want to create the table on tPostgresqlOutput component.

Regards
Shong

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hi
You need to specify the length and precision of column on the schema if you want to create the table on tPostgresqlOutput component.

Regards
Shong
Anonymous
Not applicable
Author

PostgreSQL don't require precision or scale :

"without any precision or scale creates a column in which numeric values of any precision and scale can be stored, up to the implementation limit on precision."

 

It is unfortunate that Talend return an error whereas the SQL statement will be correct without the 0 added.

 

Whatever, thanks a lot Shong for your quick answer!!