-- Oracle Table Definition
--
-- RCS Revision
--   $Id: policy_login.oracle,v 1.1 1999/02/02 17:08:01 roberts Exp $
--

CREATE SEQUENCE policy_login_seq START WITH 1;

CREATE TABLE policy_login (
    x_rowid int DEFAULT 0 PRIMARY KEY,
    pid int DEFAULT 0,
    login varchar2(10) NOT NULL,
    acl_view varchar2(1),
    acl_delete varchar2(1),
    acl_create varchar2(1),
    acl_child varchar2(1),
    acl_modify varchar2(1),
    acl_follow varchar2(1),
    acl_email varchar2(1),
    acl_close varchar2(1)
);

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