Monday, 29 July 2019

How to create the dummy table and find the value in Oracle R12


CREATE TABLE TAB_DUMMY ("SNO"  NUMBER, "VALUE" VARCHAR2 (4000 BYTE));


CREATE SEQUENCE SNO_DUMMY
   MINVALUE 1
   MAXVALUE 9999999999999999999999999999
   INCREMENT BY 1
   START WITH 1
   CACHE 20
   NOORDER
   NOCYCLE;


CREATE OR REPLACE PROCEDURE PRC_DUMMY (P_PARA VARCHAR2)
IS
   PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
   INSERT INTO TAB_DUMMY
     VALUES   (SNO_DUMMY.NEXTVAL, P_PARA);

   COMMIT;
END;


-- prc_dummy ('lv_sysdate=' || lv_sysdate);