text: /* Formatted on 12-13-2018 8:48:49 AM (QP5 v5.126.903.23003) */
  
  DROP TABLE GST.GEN_STP_LOV_NAMES  CASCADE CONSTRAINTS PURGE;
  
  
  CREATE TABLE GST.GEN_STP_LOV_NAMES (
     value_list_id      NUMBER NOT NULL,
     value_list_name    VARCHAR2 (200),                           -- EXAMPLES...
     value_list_desc    VARCHAR2 (300),
     sqlquery_if_dyn    CLOB,
     defined_by         VARCHAR2 (3),                             -- EXAMPLES...
     created_by         NUMBER NOT NULL,
     creation_date      VARCHAR2 (21) NOT NULL,
     last_update_by     NUMBER NOT NULL,
     last_update_date   VARCHAR2 (21) NOT NULL,
     is_list_dynamic    VARCHAR2 (1) DEFAULT 0 NOT NULL,
     is_enabled         VARCHAR2 (1) DEFAULT 0 NOT NULL,
     dflt_order_by      VARCHAR2 (300) DEFAULT 'ORDER BY 1' NOT NULL
  )
  TABLESPACE RHODB
  PCTUSED 0
  PCTFREE 10
  INITRANS 1
  MAXTRANS 255
  STORAGE (PCTINCREASE 0 BUFFER_POOL DEFAULT)
  LOGGING
  NOCOMPRESS
  NOCACHE
  NOPARALLEL
  MONITORING;
  
  CREATE UNIQUE INDEX GST.IDX_VALUE_LIST_ID
     ON GST.GEN_STP_LOV_NAMES (VALUE_LIST_ID)
     LOGGING
     TABLESPACE RHODB
     PCTFREE 10
     INITRANS 2
     MAXTRANS 255
     STORAGE (PCTINCREASE 0 BUFFER_POOL DEFAULT)
     NOPARALLEL;
  
  DROP SEQUENCE GST.GEN_STP_LOV_NAMES_SEQ;
  CREATE SEQUENCE GST.GEN_STP_LOV_NAMES_SEQ
     START WITH 1
     MAXVALUE 9223372036854775807
     MINVALUE 1
     NOCYCLE
     NOCACHE
     ORDER;
  
  ALTER TABLE GST.GEN_STP_LOV_NAMES ADD (
    CONSTRAINT PK_VALUE_LIST_ID
   PRIMARY KEY
   (VALUE_LIST_ID));
  
  /*COMMENT ON COLUMN GST.GEN_STP_LOV_NAMES.VALUE_LIST_NAME IS
  'EXAMPLES
  BENEFITS TYPES
  RELATIONSHIP TYPES
  EMPLOYMENT TYPES
  COUNTRIES
  CURRENCIES
  DIVISIONS OR GROUP TYPES
  PERSON TYPE CHANGE REASONS
  PERSON TYPES
  QUALIFICATION TYPES
  NATIONAL ID TYPES
  MEMBERSHIP TYPES
  ';
  
  COMMENT ON COLUMN GST.GEN_STP_LOV_NAMES.DEFINED_BY IS
  'EXAMPLES
  1. SYS
  2. USR';*/
  
  
  -- INDEX: GST.IDX_VALUE_LIST_DESC
  
  -- DROP INDEX GST.IDX_VALUE_LIST_DESC;
  
  --DROP INDEX SYS.IDX_VALUE_LIST_DESC;
  --DROP INDEX SYS.IDX_VALUE_LIST_NAME;
  
  
  CREATE INDEX GST.IDX_VALUE_LIST_DESC
     ON GST.GEN_STP_LOV_NAMES (VALUE_LIST_DESC)
     LOGGING
     TABLESPACE RHODB
     PCTFREE 10
     INITRANS 2
     MAXTRANS 255
     STORAGE (PCTINCREASE 0 BUFFER_POOL DEFAULT)
     NOPARALLEL;
  
  
  CREATE INDEX GST.IDX_VALUE_LIST_NAME
     ON GST.GEN_STP_LOV_NAMES (VALUE_LIST_NAME)
     LOGGING
     TABLESPACE RHODB
     PCTFREE 10
     INITRANS 2
     MAXTRANS 255
     STORAGE (PCTINCREASE 0 BUFFER_POOL DEFAULT)
     NOPARALLEL;
  
  CREATE OR REPLACE TRIGGER GST.GEN_STP_LOV_NAMES_TRG
     BEFORE INSERT
     ON GST.GEN_STP_LOV_NAMES
     FOR EACH ROW
     -- OPTIONALLY RESTRICT THIS TRIGGER TO FIRE ONLY WHEN REALLY NEEDED
     WHEN (NEW.VALUE_LIST_ID IS NULL)
  DECLARE
     V_ID   GST.GEN_STP_LOV_NAMES.VALUE_LIST_ID%TYPE;
  BEGIN
     SELECT   GST.GEN_STP_LOV_NAMES_SEQ.NEXTVAL INTO V_ID FROM DUAL;
  
     :NEW.VALUE_LIST_ID := V_ID;
  END GEN_STP_LOV_NAMES_TRG;