デュアルの時間と分をテーブルに保存されている実際のデータと比較しようとしています。
TO_CHAR(sysdate,'HH.MI') は char を返しますが、私のデータには浮動小数点数が含まれています
しかし、 no data found と表示されます。
私はこれをやろうとしています:
create or replace function getSysTime
return char
is
hhhh intervals.interval_end%type;
v_interval_start intervals.interval_start%type;
v_interval_end intervals.interval_end%type;
v_interval_id intervals.interval_id%type;
begin
select INTERVAL_START ,INTERVAL_END , INTERVAL_ID , TO_CHAR(sysdate,'HH.MI')
into v_interval_start , v_interval_end , v_interval_id , hhhh
from INTERVALS
where hhhh = INTERVAL_START ;
return v_interval_id;
end;
で解決:
sloved by using cast char to float .
where cast (TO_CHAR(sysdate,'HH.MI') as float) between INTERVAL_START and INTERVAL_END ;