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 Tlocatretour2021 values (dnoclient,'&vnovehicule',ddatedebut,dkmdeb,&vkmfin,to_date('15-12-2019','DD-MM-YYYY'));
Insert into tligne values ('Retour bien effectue '); Insert into tligne values ('Retour bien effectue ');
Delete Tlocation2021 WHERE noveh='&vnovehicule';
Insert into tligne values ('Effacement location en cours ');
end if; end if;
end if; end if;

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

Loading…
Cancel
Save