gmitter-ef commented on issue #5182: URL: https://github.com/apache/hop/issues/5182#issuecomment-3561676657
Hi all! I found a way to use variables in the outsourced SQL files that get injected in the "Table input" transform via the "resolve-sql-file-input" resolver: Use another resolver ;-) The resolver takes any variable name (here: "MY_VAR"), and a JavaScript returns the content of the variable with this name. Resolver "resolve-variable" with relevant JavaScript code: <img width="778" height="651" alt="Image" src="https://github.com/user-attachments/assets/ed3f3051-c444-4f2c-a225-7b017929d32e" /> Usage in the outsourced SQL code that gets injected into the "Table input" with the "resolve-sql-file-input" resolver: <img width="1021" height="45" alt="Image" src="https://github.com/user-attachments/assets/2d1c64de-bc8e-4beb-93bb-da38d400d760" /> In contrast to directly write "${MY_VAR}" in the SQL code (which doesn't get resolved when the SQL file is injected via the first resolver), this way - using "resolve-variable" resolver - the variable gets correctly resolved! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
