I have Oracle Query as part of complex SQL script
"select sysdate into run_date from dual;"
The run_date is used elsewhere in the script.
I've converted this into PostgreSQL as
"select current_timestamp into lv_run_date"
since there is no dual equivalent in PostgreSQL. This works fine for first time and time stamp is stored.
However if run the query next time it throws error relation "run_date" already exists. I want current timestamp to be stored when it is run nexts time instead it throws error. How to fix it.
INTOmeans "into a variable" in PL/pgSQL (just as in PL/SQL) , but means "into a table" (i.e. create table) in Postgre's SQL.