quentinhoareau / sql_project_mopolo

0 stars 0 forks source link

Package 3 - Table BATEAU_TYPE #40

Closed quentinhoareau closed 2 years ago

quentinhoareau commented 2 years ago

Vos missions pour ce package :

⚠️ Chaque package doit avoir au moins 2 type qui se trouve dans cette liste : CONSULTATION / SUPRESSION / MISE A JOURS / CONSULTATION

ℹ️ Docs utile : https://www.tutorialspoint.com/plsql/plsql_packages.htm


❗ Exemple Package :

-- ******** Exemple de squelette d'un package ********
CREATE OR REPLACE PACKAGE RESERVATION_PACKAGE AS 

   -- Insertion
   PROCEDURE ajouterReservation(...); 

   --Consulation
   FUNCTION prixReservation(...); 

END RESERVATION_PACKAGE; 
/

CREATE OR REPLACE PACKAGE BODY RESERVATION_PACKAGE AS 
   PROCEDURE ajouterReservation(...) 
   IS 
   BEGIN 
      ...
   END addCustomer; 

   FUNCTION prixReservation(...) 
   IS 
   BEGIN 
      ...
   END prixReservation; 

END RESERVATION_PACKAGE; 
/

-- ******** Exemple d'un test Package ********
DECLARE 
   prix number; 
   imma reservation.BT_IMMATRICULE%type;
   date_debut reservation.RES_DATE_DEBUT%type;
BEGIN 
   imma:= 'MAF43878';
   date_debut:= TO_DATE('2022-04-20 09:00:00','yyyy-mm-dd hh24:mi:ss');

   prix := RESERVATION_PACKAGE.prixReservation(imma,date_debut); 
   dbms_output.put_line('Prix de la réservation: ' || prix); 
END; 
mamadou-mouctar-diallo commented 2 years ago

it's ok @quentinhoareau Sorry for the late it's because of work guy. thank you