Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

BETWEEN FUNCTION WITH IN A DECODE FUNTION IN A CURSOR

Uday_NSep 6 2010 — edited Sep 6 2010
The following below is my query..I have to get the hours,min and seconds from a 'yyyy-mm-dd-24hh.mi.ss' value and check if the time is between 12 am to 6 am , then write it with one value else write an another value..I am trying to use 'BETWEEN' function in decode function but i am getting error.....Can we use BETWEEN function with in decode function or is there any other way




set serveroutput on

declare
cursor cur_dte is select lst_upd_date from EMPLOYESS ;

begin
for i in cur_dte loop




DECODE (substr(trim(i.lst_upd_date),12)) ,between '00.00.00.0000' and '06.00.00.00.0000' ,101,102);

dbms_output.put_line(i.lst_upd_date);

end loop;
end
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 4 2010
Added on Sep 6 2010
5 comments
11,417 views