SHARE
TWEET

Untitled

a guest Jun 18th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Crea Tabla (Sección 2)
  2. CREATE GLOBAL TEMPORARY table TMP_PRODS_SAL
  3.    (V_Prod varchar2(13),
  4.     V_Indice NUMBER GENERATED ALWAYS  AS IDENTITY) ON COMMIT DELETE ROWS;
  5.  
  6. -- Ejemplo para Retornar el campo IDENTITY (Sección 3)
  7. SET SERVEROUTPUT ON
  8. DECLARE
  9.   VV_Indice TMP_PRODS_SAL.V_Indice%TYPE;
  10.   VV_Prod varchar2(13);
  11. BEGIN
  12.         begin
  13.             VV_Prod:= '1234567890123';
  14.             insert into TMP_PRODS_SAL (V_Prod) values(VV_Prod);
  15.     --        VV_Indice:= SCOPE_IDENTITY();
  16.     --        RETURNING TMP_PRODS_SAL.V_Indice INTO VV_Indice;
  17.     --        SELECT SCOPE_IDENTITY() AS SEQ;
  18.         end;
  19.         DBMS_OUTPUT.put_line('UPDATE ID=' || VV_Indice);
  20. end;
  21.  
  22. -- Lectura de Tabla (Sección 4)
  23. select * from TMP_PRODS_SAL;
  24.  
  25. -- Borrar Registros (Sección 5)
  26.  commit;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top