I have a problem with a very simple piece of code, and I am hoping someone can tell me where I have gone wrong – the code is
DECLARE AnalysisDate DATE := '2024-06-27';
SELECT TO_VARCHAR(:AnalysisDate, 'YYYYMMDD');
This gives the error:
Syntax error: unexpected 'SELECT'.
My ultimate goal is to pass a date value into a procedure and have it form part of a file path.