master
Pascal LAFOURCADE 4 years ago
parent e6f01344df
commit 321b0ecadc

@ -15,12 +15,12 @@
-- VE004 -- VE004
-- Vehicule pas en cours de location -- Vehicule pas en cours de location
-- VE003 -- VE003
-- '03-JAN-2007' -- '03-JAN-20022'
-- 370000 -- 370000
-- PB date de retour inf date debut -- PB date de retour inf date debut
-- VE003 -- VE003
-- '03-JAN-2018' -- '03-JAN-2022'
-- 37 -- 37
-- PB Km de retour inf KM debut -- PB Km de retour inf KM debut
@ -31,7 +31,7 @@
-- 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));
@ -41,7 +41,7 @@ set verify off;
set feed off; set feed off;
variable vnovehicule char(5); variable vnovehicule char(5);
variable vdateretour date; variable vdateretour char(10);
variable vkmfin number; variable vkmfin number;
prompt Entrer le numero du vehicule : prompt Entrer le numero du vehicule :
@ -64,20 +64,20 @@ 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 >= &vdateretour) if (ddatedebut >= TO_DATE(&vdateretour,'DD-MM-YYYY'))
then Insert into tligne values ('PB date de retour inf date debut'); then Insert into tligne values ('PB date de retour inf date debut');
else else
@ -85,8 +85,8 @@ 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-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 ');
end if; end if;

@ -268,17 +268,17 @@ Les messages suivants sont à prévoir :
-- VE004 -- VE004
-- Vehicule pas en cours de location -- Vehicule pas en cours de location
-- VE003 -- VE003
-- '03-JAN-2007' -- '03-JAN-2022'
-- 370000 -- 370000
-- PB date de retour inf date debut -- PB date de retour inf date debut
-- VE003 -- VE003
-- '03-JAN-2020' -- '03-JAN-2022'
-- 37 -- 37
-- PB Km de retour inf KM debut -- PB Km de retour inf KM debut
-- VE004 -- VE004
-- '03-JAN-2020' -- '03-JAN-2022'
-- 4000000 -- 4000000
-- ORA-00001 : pb de clef non respectee -- ORA-00001 : pb de clef non respectee
@ -292,7 +292,7 @@ CREATE TABLE tligne (ligne varchar2(100));
set echo off; set verify off; set feed off; set echo off; set verify off; set feed off;
variable vnovehicule char(5); variable vnovehicule char(5);
variable vdateretour date; variable vdateretour char(10);
variable vkmfin number; variable vkmfin number;
prompt Entrer le numero du vehicule : prompt Entrer le numero du vehicule :
@ -328,7 +328,7 @@ select datedeb, kmdeb, noclient into ddatedebut, dkmdeb, dnoclient
from Tlocation2017 from Tlocation2017
where noveh='&vnovehicule'; where noveh='&vnovehicule';
if (ddatedebut >= &vdateretour) if (ddatedebut >= TO_DATE(&vdateretour,'DD-MM-YYYY'))
then Insert into tligne values ('PB date de retour inf date debut'); then Insert into tligne values ('PB date de retour inf date debut');
else else

Loading…
Cancel
Save