I try to write a procedure to know the datetime from a timezone to another timezone I can't compile because the format date is not valid and I don't know how to manage the variable. Can you give me a tip, please
create or replace PROCEDURE DATETIME_FROM_TO
(
VALUE$DATETIME in date,
VALUE$FROM in varchar2,
VALUE$TO in varchar2,
FLAG in number
) AS c1 SYS_REFCURSOR;
begin
VALUE_DATETIME := VALUE$DATETIME;
VALUE_FROM := VALUE$FROM;
VALUE_TO := VALUE$TO;
if FLAG=12 then
open c1 for
select to_char(from_tz(TIMESTAMP 'VALUE_DATETIME', 'VALUE$FROM') at time zone 'VALUE$TO','DD/MM/YYYY HH:MI PM') as localtime into c1 from dual;
else
open c1 for
select to_char(from_tz(TIMESTAMP 'VALUE$DATETIME', 'VALUE$FROM') at time zone 'VALUE$TO','DD/MM/YYYY HH24:MI') as localtime into c1 from dual;
end if;
DBMS_SQL.RETURN_RESULT(c1);
close c1;
end;
thank you