要实现这个功能:
要判断时间,是否是每个月的3号上午8点,到6号晚上12点这段时间。
请指示!

解决方案 »

  1.   

    不知道你想实现什么效果。如果是判断时间,直接从数据库读出当前时间进行判断就可以了呀。
    select sysdate from dual;
      

  2.   


    create table test(
    id int,
    time date
    );insert into test values(1,to_date('2012.04.03 02:03:04','yyyy.mm.dd hh24:mi:ss'));
    insert into test values(1,to_date('2012.04.03 12:03:04','yyyy.mm.dd hh24:mi:ss'));
    insert into test values(1,to_date('2012.04.06 11:03:04','yyyy.mm.dd hh24:mi:ss'));
    insert into test values(1,to_date('2012.04.06 12:03:04','yyyy.mm.dd hh24:mi:ss'));
    insert into test values(1,to_date('2012.04.07 12:03:04','yyyy.mm.dd hh24:mi:ss'));select id,to_char(time,'yyyy-mm-dd hh24:mi:ss') 日期
    from test where to_char(time,'dd hh24:mi:ss') 
    between '03 08:00:00' and '06 12:00:00';
    --你的存储过程按类似这个格式判断就可以了
    --结果
            ID 日期                                                                 
    ---------- --------------------------------------                               
             1 2012-04-03 12:03:04                                                  
             1 2012-04-06 11:03:04