mardi 12 juillet 2011

OUT : valeur de retour d'une procedure

Les procédures Oracle offrent la possibilité de renvoyer une valeur en sortie au travers d'une variable OUT définie dans la liste des paramètres de la procédure.

CREATE OR REPLACE PROCEDURE p_sqrt(
    a IN NUMBER, b OUT NUMBER
) AS
BEGIN
    b:=a*a;
END;
/

SET SERVEROUTPUT ON SIZE 2000

DECLARE
  entree NUMBER;
  sortie NUMBER;
BEGIN
  entree:=9;
  p_sqrt(entree,sortie);
  dbms_output.put_line(entree||'² = '||sortie);
END;
/
9² = 81

PL/SQL procedure successfully completed.

1 commentaire:

  1. Buy Neds Titanium Wedding Rings from India Today - Tatiana
    › Buy › titanium hammers Neds › MENS-TIPTONIAN › Buy › Neds black titanium wedding band › MENS-TIPTONIAN Buy Neds Titanium Wedding Rings from India Today. smith titanium Shop the best Neds Titanium Wedding Rings products titanium watch on Tatiana. used ford fusion titanium

    RépondreSupprimer