Hi Team, I am using the component "Query Result to Scalar" and have defined the below SQL.
select
coalesce(
nullif('${JV_SCN}', '')
, (SELECT MAX(SRC_SCN)::STRING FROM ${EV_ODS_NAME}.${JV_TARGET_SCHEMA}.${JV_TARGET_TABLE})
, '0'
) AS MAX_SCN
However, I am getting the error "Column doesn't exist in input : MAX_SCN" though the above SQL returns MAX_SCN as column. Please guide me on how to resolve this issue.
As you have parameterized the database, schema, and table name, Matillion is not able to validate the query. For the first time for matillion to validate, use the actual values. Later even if you parameterize them, it will work properly when you run the flow. (it will still show the error in the validation of the component, but while the run the actual values will be passed to the variables and it will not fail).