Hi there....the Oracle experts
I am new using Oracle only a few weeks, but with some
Informix background with both 4gl and Isql. Please
help me how to fix this alert and trigger problems.
Both my screen forms using Oracle Dev. 2000 form 4.5
on Oracle 7.3.3 works well for todays flight without
registration number and the other one is for the similar
aircraft in the past but still here in the airport.
FYO, our new international airport always been visited
by the 'allien' aircrafts that no registration, so we
have to take actions for the services, charges, rents etc.
my problem is how to make the allert button works. Now when
I pressed the button, only the message from the alert properties
come out but for the trigger from PL/SQL don't, anybody knows
how to fix ?
my main logic/psudeocode is as follows :-
select count(*) the aircraft without registration
number for today;
if the count > 1 (at least one aircraft exist) then
display meassage ('the will be x numbers of aircraft
without registration number today');
and
display flight_no, atmsetad, A/D, D/I, time in hr, mi, etc;
else
display message ('there is NO flight without registration
number today');
end if;
both the sql's for the count(*) and detail flight works fine when
I tested in the sqlplus but not in the PL/SQL editor & trigger in
the form45. Any one have better idea how to link the above sqls
into my alert button ? Thanks in advance.
Dan.
------------------------------------------------------------------
This is the SQL's for the above problems, for within 10 hours
(600 min) from the current time :-
1) select count(*)
from flight
where trunc(atmsetad) = trunc(sysdate)
and (to_number(to_char(atmsetad,'hh24mi'))-to_number
(to_char(sysdate,'hh24mi'))) between 1 and 600
and atmsatad is null and (aircraft_reg_no is null
or aircraft_reg_no = 'NOREGN');
the result :
========
COUNT(*)
---------------
8
========
2) select flight_no, to_char(atmsetad,'dd-MON-yyyy hh24:mi:ss')
atmsetad_disp, to_char(sysdate,'dd-MON-yyyy hh24:mi:ss')
sysdate_disp, (to_number(to_char(atmsetad,'hh24mi'))-
to_number(to_char(sysdate,'hh24mi'))) min_diff,
trunc((to_number(to_char(atmsetad,'hh24mi'))-to_number
(to_char(sysdate,'hh24mi')))/60) hour_diff, mod((to_number
(to_char(atmsetad,'hh24mi'))-to_number (to_char(sysdate,
'hh24mi'))),60) min_mod, leg, category_code,aircraft_reg_no
from flight
where trunc(atmsetad) = trunc(sysdate)
and (to_number(to_char(atmsetad,'hh24mi'))-to_number(to_char
(sysdate,'hh24mi'))) between 1 and 600 and atmsatad is
null and (aircraft_reg_no is null
or aircraft_reg_no = 'NOREGN')
order by (to_number(to_char(atmsetad,'hh24mi'))-to_number
(to_char(sysdate,'hh24mi')));
the results : 8 rows selected.
==============================================================
FLIGHT_N ATMSETAD_DISP SYSDATE_DISP MIN_ HOUR_ MIN_ L C
ACRAFT_
DIFF DIFF MOD
REG_NO
---------------------------------------------------------------------------
------------------------------------------------
NG 0002 27-JAN-1999 19:35:00 27-JAN-1999 16:41:10 294 4 54 A I
NOREGN
MH 0008 27-JAN-1999 19:35:00 27-JAN-1999 16:41:10 294 4 54 A I
NOREGN
5X 0683N 27-JAN-1999 20:35:00 27-JAN-1999 16:41:10 394 6 34 A I
NOREGN
NG 0002 27-JAN-1999 21:25:00 27-JAN-1999 16:41:10 484 8 4 D I
NOREGN
MH 0008 27-JAN-1999 21:25:00 27-JAN-1999 16:41:10 484 8 4 D I
NOREGN
SV 0882 27-JAN-1999 22:00:00 27-JAN-1999 16:41:10 559 9 19 A I
NOREGN
CS 0879 27-JAN-1999 22:25:00 27-JAN-1999 16:41:10 584 9 44 A I
NOREGN
MH 0031 27-JAN-1999 22:30:00 27-JAN-1999 16:41:10 589 9 49 A I
NOREGN
================================================================