Pascal LAFOURCADE 4 years ago
parent 321b0ecadc
commit 7135db0d6b

@ -89,6 +89,11 @@ Insert into Tlocatretour2021 values (dnoclient,'&vnovehicule',ddatedebut,dkmdeb,
-- Insert into Tlocatretour2021 values (dnoclient,'&vnovehicule',ddatedebut,dkmdeb,&vkmfin,to_date('15-12-2019','DD-MM-YYYY'));
Insert into tligne values ('Retour bien effectue ');
Delete Tlocation2021 WHERE noveh='&vnovehicule';
Insert into tligne values ('Effacement location en cours ');
end if;
end if;

@ -164,15 +164,15 @@ begin
dmessage := '&vnumvehicule'||' vehicule inconnu';
select immat, modele into dimmatriculation, dmodele
from Tvehicule2017
from Tvehicule2021
where noveh='&vnumvehicule';
dmessage := dimmatriculation||' est l immatriculation du vehicule'||'&vnumvehicule'|
|' de modele '||dmodele;
select nom into dnom
from Tclient2017, Tlocation2017
where Tlocation2017.noveh='&vnumvehicule' and Tlocation2017.noclient=Tclient2017.noclient;
from Tclient2021, Tlocation2021
where Tlocation2021.noveh='&vnumvehicule' and Tlocation2021.noclient=Tclient2021.noclient;
Insert into tligne values (dmessage||' loue par '||dnom);
@ -218,7 +218,7 @@ dnovehicule char(5);
BEGIN
select noveh into dnovehicule
from Tlocation2017
from Tlocation2021
where noclient='&vnoclient';
Insert into tligne values ('vehicule '||dnovehicule||' est loue par '||'&vnoclient');
@ -284,7 +284,7 @@ Les messages suivants sont à prévoir :
-- ORA-00001 : pb de clef non respectee
-- ORA-02290 : check constraint Viole les contraintes d'integrite du modele.
insert into Tlocation2017 values ('C002','VE004',to_date('29-01-2016','DD-MM-YYYY'),to_date('10-02-2017','DD-MM-YYYY'),5000);
insert into Tlocation2021 values ('C002','VE004',to_date('29-01-2016','DD-MM-YYYY'),to_date('10-02-2021','DD-MM-YYYY'),5000);
DROP TABLE tligne;
CREATE TABLE tligne (ligne varchar2(100));
@ -315,17 +315,17 @@ begin
dmessage:='numero de vehicule inconnu';
select noveh into dnovehicule
from Tvehicule2017
from Tvehicule2021
where noveh='&vnovehicule';
dmessage:='Vehicule pas en cours de location';
select noclient into dnoclient
from Tlocation2017
from Tlocation2021
where noveh='&vnovehicule';
select datedeb, kmdeb, noclient into ddatedebut, dkmdeb, dnoclient
from Tlocation2017
from Tlocation2021
where noveh='&vnovehicule';
if (ddatedebut >= TO_DATE(&vdateretour,'DD-MM-YYYY'))
@ -336,17 +336,21 @@ if (dkmdeb >= &vkmfin)
then Insert into tligne values ('PB Km de retour inf KM debut');
else
Insert into Tlocatretour2017 values (dnoclient,'&vnovehicule',ddatedebut,dkmdeb,&vkmfin,to_date(&vdateretour,'DD-MM-YYYY'));
-- Insert into Tlocatretour2017 values (dnoclient,'&vnovehicule',ddatedebut,dkmdeb,&vkmfin,to_date('15-12-2021','DD-MM-YYYY'));
Insert into Tlocatretour2021 values (dnoclient,'&vnovehicule',ddatedebut,dkmdeb,&vkmfin,to_date(&vdateretour,'DD-MM-YYYY'));
-- Insert into Tlocatretour2021 values (dnoclient,'&vnovehicule',ddatedebut,dkmdeb,&vkmfin,to_date('15-12-2021','DD-MM-YYYY'));
Insert into tligne values ('Retour bien effectue ');
Delete Tlocation2021 WHERE noveh='&vnovehicule';
Insert into tligne values ('Effacement location en cours ');
end if;
end if;
exception
when no_data_found
then insert into tligne values (dmessage);
end;
.
/

Loading…
Cancel
Save