CREATE OR REPLACE 
  PROCEDURE create_producer (
    lastname IN VARCHAR2  
  , firstname IN VARCHAR2  
  ) 
AS 
  duplicate_data number;
BEGIN
  IF 
    lastname = '' 
    OR lastname is NULL
    OR firstname = ''
    OR lastname is NULL THEN
      dbms_output.put_line('Wrong parameters, check it again please');
  ELSE
    SELECT 
      count(*)
    INTO
      duplicate_data
    FROM
      producteur p
    WHERE
      p.nom    = lastname AND
      p.prenom = firstname;
    
    IF duplicate_data > 0 THEN
      dbms_output.put_line('Duplicate data, check the firstname or the lastname');
    ELSE
      INSERT INTO producteur 
        (nom,prenom)
      VALUES
        (lastname,firstname);
      dbms_output.put_line('Insertion success');
    END IF;
  END IF;
END CREATE_PRODUCER;