Dear all
pleas help me for the following situation.
I have a table name as scrap_mst with the following structure.
FROM_DT DATE
TO_DT DATE
REF_NO VARCHAR2(20)
with the following data.
01-JAN-05 31-DEC-05 SVC/TS/1235
01-MAR-06 30-JUN-06 SVC/TS/4444
now i want to restrict user to input the date in "to_dt" column in form level.means user cannot input the date range (already exist in scrap_mst table) between the following values
01JAN05 TO 31DEC05
01MAR06 TO 30JUN06
but can input the values not in a range of above values like
01JAN06 TO 28FEB08
01JAN07 TO 31DEC08
kindly suggest how can i implement the above codition.
I have implemented the following code in a to_date column of forms 6i on when validate item but its not working and give error "bad bind variable 'scrap_mst.to_dt".
Declare
cursor c1 is select from_dt,to_dt
from scrap_mst;
dt1 date;
dt2 date;
Begin
open c1;
loop
fetch c1 into dt1,dt2;
if :scrap.mst.to_dt between c1.from_dt and c1.to_dt then
show_common_message('Already exist ......');
Else
null;
End if;
exit when c1%notfound;
end loop;
close c1;
End;
please suggest