Repository navigation
Expand file tree
/
Copy pathprocedures.sql
More file actions
51 lines (41 loc) · 1.71 KB
/
Copy pathprocedures.sql
File metadata and controls
51 lines (41 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--adding flight details
create or replace procedure add_flight(FLIGHT_ID int, airline in varchar2, departure in varchar2, destination in varchar2, departure_time timestamp, arrival_time timestamp, seats_available int, base_price int, admin_id int) as
begin
insert into flight values(flight_id, airline, departure, destination, departure_time, arrival_time, seats_available, base_price, admin_id);
end;
--delete flight
create or replace procedure delete_flight(fid number) as
begin
delete from FLIGHT where FLIGHT.FLIGHT_ID=fid;
end;
--adding airtime details
create or replace procedure add_airtime(DEPARTURE in varchar2, DESTINATION in varchar2, DURATION in varchar2) as
begin
insert into airtime values(DEPARTURE, DESTINATION, DURATION);
end;
--delete airtime details
create or replace procedure delete_airtime(DEPARTURE in varchar2, DESTINATION in varchar2) as
begin
delete from airtime where airtime.DEPARTURE=DEPARTURE and airtime.DESTINATION=DESTINATION;
end;
--add customer
create or replace procedure add_customer(cid number, fname in varchar2, lname in varchar2, dob date, email in varchar2, mobile in varchar2, passwd in varchar2) as
begin
insert into customer values(cid, fname, lname, dob, email, mobile, passwd);
end;
--delete customer
create or replace procedure delete_customer(cid number) as
begin
delete from customer where CID=cid;
end;
--add ticket
create or replace procedure add_ticket( cid number, fid number, food_pref in varchar2, is_valid number) as
begin
INSERT INTO TICKET(CID,FLIGHT_ID,FOOD_PREF,isVALID)
VALUES(cid, fid, food_pref ,is_valid);
end;
-- delete ticket
create or replace procedure delete_ticket(tid number) as
begin
delete from ticket where ticket.TICKET_ID=tid;
end;