Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create or replace procedure sendv2 (
- cod_t trips.cod_trip%type
- )
- as
- t integer;
- trp trips%rowtype;
- cbs buses.cod_model%type;
- pl models.places%type;
- begin
- select tickets into t from trips where cod_trip=cod_t;
- select * into trp from trips where cod_trip=cod_t;
- select cod_model into cbs from buses where cod_bus=trp.cod_bus;
- select places into pl from models where cod_model=cbs;
- if t > 0 then
- insert into sent_trips (hour, minute, week_day, sent_day, fill_bus, tickets, сod_trip, сod_route, cod_bus, cod_model)
- values (trp.hour, trp.minute, trp.week_day, sysdate, (trp.tickets/pl)*100, trp.tickets, cod_t, trp.cod_route, trp.cod_bus, cbs);
- update trips set tickets=0 where cod_trip=cod_t;
- end if;
- end;
- /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement