-- Oracle Table Definition
--
-- RCS Revision
--   $Id: ebulk.oracle,v 1.2 2000/02/02 03:57:13 shevett Exp $
--

CREATE SEQUENCE ebulk_seq START WITH 1;

CREATE TABLE ebulk (
    x_rowid number(10) DEFAULT 0 PRIMARY KEY,
    btable varchar2(15) NOT NULL,
    belement varchar2(15),
    bvalue varchar2(80),
		bkeyref varchar2(80),
    browref number(10) DEFAULT 0
);

CREATE INDEX ebulk_browref_idx ON ebulk(browref);

CREATE OR REPLACE TRIGGER ebulk_trg_bir
BEFORE INSERT ON ebulk
FOR EACH ROW
BEGIN
    IF :new.x_rowid IS NULL OR :new.x_rowid = 0
    THEN
        SELECT ebulk_seq.nextval INTO :new.x_rowid FROM dual;
    END IF;
END;
/
