"Fossies" - the Fresh Open Source Software Archive

Member "opensips-3.0.1/scripts/oracle/group-create.sql" (16 Apr 2019, 936 Bytes) of package /linux/misc/opensips-3.0.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PL/SQL source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 INSERT INTO version (table_name, table_version) values ('grp','3');
    2 CREATE TABLE grp (
    3     id NUMBER(10) PRIMARY KEY,
    4     username VARCHAR2(64) DEFAULT '',
    5     domain VARCHAR2(64) DEFAULT '',
    6     grp VARCHAR2(64) DEFAULT '',
    7     last_modified DATE DEFAULT to_date('1900-01-01 00:00:01','yyyy-mm-dd hh24:mi:ss'),
    8     CONSTRAINT grp_account_group_idx  UNIQUE (username, domain, grp)
    9 );
   10 
   11 CREATE OR REPLACE TRIGGER grp_tr
   12 before insert on grp FOR EACH ROW
   13 BEGIN
   14   auto_id(:NEW.id);
   15 END grp_tr;
   16 /
   17 BEGIN map2users('grp'); END;
   18 /
   19 INSERT INTO version (table_name, table_version) values ('re_grp','2');
   20 CREATE TABLE re_grp (
   21     id NUMBER(10) PRIMARY KEY,
   22     reg_exp VARCHAR2(128) DEFAULT '',
   23     group_id NUMBER(10) DEFAULT 0 NOT NULL
   24 );
   25 
   26 CREATE OR REPLACE TRIGGER re_grp_tr
   27 before insert on re_grp FOR EACH ROW
   28 BEGIN
   29   auto_id(:NEW.id);
   30 END re_grp_tr;
   31 /
   32 BEGIN map2users('re_grp'); END;
   33 /
   34 CREATE INDEX re_grp_group_idx  ON re_grp (group_id);
   35