iamgoce
New Contributor III

What's worked for us is to use a string variable to construct the query and then use EXECUTE IMMEDIATE to execute the query:

DECLARE OR REPLACE VAR QUERY;
SET VAR QUERY = 'SELECT * FROM TABLE_CHANGES("catalog.schema.table", "' || timestamp_start || '" , "' || timestamp_end || '")';
EXECUTE IMMEDIATE QUERY

You can also put it in begin/end compound statement as well.