RDBMS version: 19c
At the start of execution of an SQL script (which will executed from SQL*Plus), I want to print the following
Processing started at: 13-Aug-2022 18:45
So, in SQL*Plus, I tried the following. No luck. What am I doing wrong ?
SQL> select 'Processing started at: to_char(sysdate, 'DD-MON-YYYY HH24:MI')' from dual;
SP2-0552: Bind variable "MI" not declared.
SQL>
SQL> select 'Processing started at: to_char(sysdate, 'DD-MON-YYYY HH24\:MI')' ESCAPE '\' FROM DUAL;
SP2-0552: Bind variable "MI" not declared.
-- Tried enclosing the entire string in double quotes. But, SQL*Plus didn't like it
SQL> select "Processing started at: to_char(sysdate, 'DD-MON-YYYY HH24\:MI')" ESCAPE '\' FROM DUAL;
select "Processing started at: to_char(sysdate, 'DD-MON-YYYY HH24\:MI')" ESCAPE '\' FROM DUAL
*
ERROR at line 1:
ORA-00923: FROM keyword not found where expected