Skip to main content
Question

How to get the value of a numeric attribute in a SQL Executor transformer and make use of it in a query


Hello,

 

I would like to get the value that comes from a Counter transformer through the Initiator input in a SQL Executor transformer, to make a query that uses this number

 

Here is my request:

 

FME_SQL_DELIMITER ;

alter sequence cajxg_CE_sequence increment by '@Value(COUNTER)';

 

I tried or without the quotes, I also tried using TO_NUMBER and if I replace my attribute by a number, it works

 

But when I perform the query I get the error ORA-01722 (Invalid Number)

 

When I try to do a select with this attribute, it works

 

Thanks,

3 replies

david_r
Celebrity
  • February 15, 2022

You should remove the single quotes around the number. Also you don't need to use the FME_SQL_DELIMITER when there's only one statement. Try this:

alter sequence cajxg_CE_sequence increment by @Value(COUNTER)

Just make sure that COUNTER only contains digits.

 


david_r wrote:

You should remove the single quotes around the number. Also you don't need to use the FME_SQL_DELIMITER when there's only one statement. Try this:

alter sequence cajxg_CE_sequence increment by @Value(COUNTER)

Just make sure that COUNTER only contains digits.

 

Thank you David,

 

But I have the same error ,

 

Yes, the COUNTER only contains digits,


david_r
Celebrity
  • February 15, 2022
contoisnicolas wrote:

Thank you David,

 

But I have the same error ,

 

Yes, the COUNTER only contains digits,

Try outputting the full SQL statement to the FME log with the Logger, then post a screenshot of the SQL statement here.


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