Trying to use INTERVAL '1' hour to add an hour to a date
I am trying to use INTERVAL '1' hour syntax in my pl/sql but having issues with hour value variable.
My goal For example:
start_date := to_date(start_date_in, 'YYYYMMDDHH24MISS');
end_date := to_date(start_date_in, 'YYYYMMDDHH24MISS') + INTERVAL '1' hour; -- this line works
HRS := '1';
start_date := to_date(start_date_in, 'YYYYMMDDHH24MISS');
end_date := to_date(start_date_in, 'YYYYMMDDHH24MISS') + INTERVAL HRS hour; -- does not work. I tried to use ''1'' or some ways but it still fails.
I know that I can use + 1/24 to get the same result but wanted to explore using INTERVAL
My goal For example:
start_date := to_date(start_date_in, 'YYYYMMDDHH24MISS');
end_date := to_date(start_date_in, 'YYYYMMDDHH24MISS') + INTERVAL '1' hour; -- this line works
HRS := '1';
start_date := to_date(start_date_in, 'YYYYMMDDHH24MISS');
end_date := to_date(start_date_in, 'YYYYMMDDHH24MISS') + INTERVAL HRS hour; -- does not work. I tried to use ''1'' or some ways but it still fails.
I know that I can use + 1/24 to get the same result but wanted to explore using INTERVAL
0