CREATE OR REPLACE PROCEDURE handleCollegien(
  id_coll number, pnom varchar2, pprenom varchar2) IS
BEGIN
  INSERT INTO collegien VALUES (id_coll,pnom, pprenom);
EXCEPTION
  WHEN DUP_VAL_ON_INDEX THEN
    UPDATE collegien SET nom = pnom, prenom = pprenom WHERE id = id_coll;
END;
/

EXEC handleCollegien(1,'andrea','machizaud');

SELECT * from collegien;

EXEC handleCollegien(1,'geoffrey','wehrle');

SELECT * from collegien;

EXEC handleCollegien(2,'florent','boillot');

SELECT * from collegien;

