by

How to create a PACKAGE in oracle

PACKAGE HEADER

create or replace PACKAGE MY_PACK AS 

  /* TODO enter package declarations (types, exceptions, methods etc) here */ 
    
  PROCEDURE PROCEDURE_1(v_texto in out varchar2);
  FUNCTION FUNCTION_1(v_parametroEntrada in varchar2) return varchar2;

END MY_PACK;

PACKAGE BODY

create or replace package body MY_PACK
IS

  PROCEDURE PROCEDURE_1(v_texto in out varchar2) IS 
  BEGIN
    v_texto := 'my return';
  END PROCEDURE_1;
  
  FUNCTION FUNCTION_1(v_parametroEntrada in varchar2) return varchar2 is
  begin
    return v_parametroEntrada;
  end;

END MY_PACK;

Escreva um comentário

Comment