Skip to main content
Question

SQL Statement to Execute after translation problem


Forum|alt.badge.img

Hello,

since updating to 2016.1 I have a problem with my sql statements to execute after translation. I need to update sequence values, because I am manually inserting data into serial column. However I am getting following error:

Error executing SQL command ('select setval('$(Schema).unip_property_attributes_id_seq', (select max(id) from $(Schema).unip_property_attributes))'): 'ERROR:  syntax error at or near "$"

LINE 1: ...property_attributes_id_seq', (select max(id) from $(Schema)....
                                                             ^

'
PostgreSQL Writer: SQL statement To Execute After Translation failed; see above for details

where unip_property_attributes_id_seq is the name of the sequence I am trying to modify (set value) and $(Schema) is a published parameter where the name of the schema is stored. Seems like after updating to 2016.1 there is some problem with addressing published parameters in sql commands after translation, because $(Schema) parameter used in sql executor seems to be working just fine (error points to $ character, which makes no sense to me). However what is mind boggling is that I have several very similar sql commands to execute after translation that were created in 2016.0 and work now even when I run the workspace in 2016.1, only this single freshly created sql does not work.

Here are the sql commands I am using, first one is giving errors, second one is working just fine:

FME_SQL_DELIMITER ;
select setval('$(Schema).unip_property_attributes_id_seq', (select max(id) from $(Schema).unip_property_attributes));



FME_SQL_DELIMITER ;
select setval('$(Schema).unip_object_id_seq', (select max(id) from $(Schema).unip_object));

Thanks for any help,

Radek

0 replies

Be the first to reply!

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings