REM
REM $Id: srw6bild.sql,v 1.6 1999/07/12 15:01:09 mgridley Exp $
REM
REM  Copyright (c) Oracle Corporation 1991.  All Rights Reserved, Worldwide.
REM
REM  srw2bild.sql
REM
REM  +--------------------------------------------------------------------+
REM  |  SRW2_MODULE - View that shows all available modules to be edited  |
REM  +--------------------------------------------------------------------+
REM
REM  NOTE: ALTER TABLE used to change tables to use ORACLE7 2000 limit
REM        instead of Version 6 255 limit (messages turned off so that error
REM        is not displayed on Version 6 install).
REM




REM  +------------------------------------------------------------------------+
REM  |  SRW2_MODULE - View on Developer/2000 module table                     |
REM  +------------------------------------------------------------------------+

CREATE VIEW SRW2_MODULE AS
  SELECT 
    DECODE(owner, user, '', owner || '.') || modname modname
  , DECODE(modtype, 'REPORT', 1, 'QUERY', 2, 'PL/SQL Library', 4, 0) modtype
  , DECODE(product, 'SQL*ReportWriter', 0, 1) generic
  , modid
  , owner
  FROM tool_module
  WHERE product = 'SQL*ReportWriter' OR
        modtype = 'QUERY'            OR
        modtype = 'PL/SQL Library';

CREATE PUBLIC SYNONYM srw2_module FOR system.srw2_module;




REM  +------------------------------------------------------------------------+
REM  |  SRW2_ANCHOR - Layout Anchor                                           |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__anchor
(
  owner      VARCHAR(30)
, modid      DECIMAL(10)
, itemid     DECIMAL(10)
, tag        DECIMAL(10)
, disp_order DECIMAL(5)
, head_id    DECIMAL(10)
, head_edge  DECIMAL(2)
, head_pct   DECIMAL(8)
, tail_id    DECIMAL(10)
, tail_edge  DECIMAL(2)
, tail_pct   DECIMAL(8)
, num_points DECIMAL(2)
, points     RAW(250)
, collapse   DECIMAL(1)
, pers_flags DECIMAL(3)
);

CREATE UNIQUE INDEX srw2_anchor_idx ON srw2__anchor
(
  owner
, modid
, itemid
);

CREATE VIEW srw2_anchor AS
  SELECT * FROM srw2__anchor
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_anchor FOR system.srw2_anchor;




REM  +------------------------------------------------------------------------+
REM  |  SRW2_BOILERPLATE - Layout Boilerplate                                 |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__boilerplate
(
  owner      VARCHAR(30)
, modid      DECIMAL(10)
, itemid     DECIMAL(10)
, name       VARCHAR(30)
, tag        DECIMAL(10)
, disp_order DECIMAL(5)
, formatflag DECIMAL(10)
, pre_code   VARCHAR(250)
, post_code  VARCHAR(250)
, x          DECIMAL(10)
, y          DECIMAL(10)
, wd         DECIMAL(10)
, ht         DECIMAL(10)
, page       DECIMAL(5)
, type       DECIMAL(5)
, num_points DECIMAL(5)
, points     RAW(250)
, graph_type DECIMAL(5)
, graph_lfid DECIMAL(10)
, graph_len  DECIMAL(10)
, close      DECIMAL(1)
, min_widows DECIMAL(5)
, min_orphan DECIMAL(5)
, max_lines  DECIMAL(5)
, text_wrap  DECIMAL(2)
, alignment  DECIMAL(5)
, arcfill    DECIMAL(1)
, arrowstyle DECIMAL(1)
, rotangle   DECIMAL(5)
, spacing    DECIMAL(10)
, linkedfile VARCHAR(250)
, pointslfid DECIMAL(10)
, ole_lfid   DECIMAL(10)
, ole_len    DECIMAL(10)
, bidi_dir   DECIMAL(5)
, assocobj   DECIMAL(10)
, pers_flags DECIMAL(3)
, group_node DECIMAL(10)
, gn_type    DECIMAL(2)
, null_ind1  DECIMAL(10)
, null_ind2  DECIMAL(10)
, null_ind3  DECIMAL(10)
, templ_id   DECIMAL(10)
, frame_id   decimal(10)
);

SET TERMOUT OFF;
ALTER TABLE srw2__boilerplate MODIFY
(
  pre_code   VARCHAR(2000)
, post_code  VARCHAR(2000)
, linkedfile VARCHAR(2000)
);
SET TERMOUT ON;

CREATE UNIQUE INDEX srw2_boilerplate_idx ON srw2__boilerplate
(
  owner
, modid
, itemid
);

CREATE VIEW srw2_boilerplate AS
  SELECT * 
  FROM srw2__boilerplate
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_boilerplate FOR system.srw2_boilerplate;





REM  +------------------------------------------------------------------------+
REM  |  SRW2_TEXT_segment - A chunk of text boilerplate                       |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__text_segment
(
  owner      VARCHAR(30)
, modid      DECIMAL(10)
, itemid     DECIMAL(10)
, seg_text   VARCHAR(250)
, seg_order  DECIMAL(5)
, tag        DECIMAL(10)
);

SET TERMOUT OFF;
ALTER TABLE srw2__text_segment MODIFY
(
  seg_text   VARCHAR(2000)
);
SET TERMOUT ON;

CREATE UNIQUE INDEX srw2_text_segment_idx ON srw2__text_segment
(
  owner
, modid
, itemid
, seg_order
);

CREATE VIEW srw2_text_segment AS
  SELECT * 
  FROM srw2__text_segment
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_text_segment FOR system.srw2_text_segment;





REM  +------------------------------------------------------------------------+
REM  |  SRW2_BUTTON - Layout Button                                           |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__button
(
  owner      VARCHAR(30)
, modid      DECIMAL(10)
, itemid     DECIMAL(10)
, name       VARCHAR(30)
, tag        DECIMAL(10)
, disp_order DECIMAL(5)
, formatflag DECIMAL(10)
, pre_code   VARCHAR(250)
, post_code  VARCHAR(250)
, x          DECIMAL(10)
, y          DECIMAL(10)
, wd         DECIMAL(10)
, ht         DECIMAL(10)
, page       DECIMAL(5)
, type       DECIMAL(5)
, source     DECIMAL(10)
, srcfile    VARCHAR(250)
, iconic     DECIMAL(1)
, lookstr    VARCHAR(250)
, bidi_dir   DECIMAL(5)
, pers_flags DECIMAL(3)
);

SET TERMOUT OFF;
ALTER TABLE srw2__button MODIFY
(
  pre_code   VARCHAR(2000)
, post_code  VARCHAR(2000)
, srcfile    VARCHAR(2000)
, lookstr    VARCHAR(2000)
);
SET TERMOUT ON;

CREATE UNIQUE INDEX srw2_button_idx ON srw2__button
(
  owner
, modid
, itemid
);

CREATE VIEW srw2_button AS
  SELECT * 
  FROM srw2__button
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_button FOR system.srw2_button;





REM  +------------------------------------------------------------------------+
REM  |  SRW2_COLUMN - Data Model Column                                       |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__column
(
  owner         VARCHAR(30)
, modid         DECIMAL(10)
, itemid        DECIMAL(10)
, name          VARCHAR(30)
, tag           DECIMAL(10)
, disp_order    DECIMAL(5)
, group_id      DECIMAL(10)
, source        DECIMAL(2)
, source_id     DECIMAL(10)
, compute_id    DECIMAL(10)
, prod_order    VARCHAR(250)
, reset_id      DECIMAL(10)
, null_value    VARCHAR(250)
, input_mask    VARCHAR(250)
, operator      DECIMAL(2)
, data_type     DECIMAL(2)
, file_type     DECIMAL(2)
, width         DECIMAL(10)
, flags         DECIMAL(5)
, precision     DECIMAL(5)
, scale         DECIMAL(5)
, x             DECIMAL(10)
, y             DECIMAL(10)
, wd            DECIMAL(10)
, ht            DECIMAL(10)
, dflt_lbl      VARCHAR(250)
, dflt_wid      DECIMAL(10)
, deref_id      DECIMAL(10)
, odata_type    DECIMAL(4)
, dflt_hgt      DECIMAL(10)
, para_type     DECIMAL(2)
, plov_rtype    DECIMAL(2)
, plov_slistid  DECIMAL(10)
, plov_select   VARCHAR(250)
, plov_col      VARCHAR(250)
, refdtype      DECIMAL(2)
, pers_flags    DECIMAL(3)
, pinned        DECIMAL(3)
, reffed_col    DECIMAL(10)
, expanded      DECIMAL(3)
, subgroup      DECIMAL(10)
, typename      VARCHAR(128)
, schema        VARCHAR(128)
, parent_col    DECIMAL(10)
, bound         DECIMAL(3)
, sortsrccol    decimal(10)
, sortcol       decimal(10)
, xml_tag       VARCHAR(250)
, xml_attr      VARCHAR(250)
, xml_suppress  NUMBER(1)
, contain_xml   NUMBER(1)
);

SET TERMOUT OFF;
ALTER TABLE srw2__column modify
(
  prod_order  VARCHAR(2000)
, null_value  VARCHAR(2000)
, input_mask  VARCHAR(2000)
, dflt_lbl    VARCHAR(2000)
, plov_select VARCHAR(2000)
);
SET TERMOUT ON;

CREATE UNIQUE INDEX srw2_column_idx ON srw2__column
(
  owner
, modid
, itemid
);

CREATE VIEW srw2_column AS
  SELECT * 
  FROM srw2__column
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_column FOR system.srw2_column;




REM  +------------------------------------------------------------------------+
REM  |  SRW2_DATA_MODEL - Data Model Header Record                            |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__data_model
(
  owner         VARCHAR(30)
, modid         DECIMAL(10)
, itemid        DECIMAL(10)
, settings      DECIMAL(10)
, zoompower     DECIMAL(5)
, window_x      DECIMAL(10)
, window_y      DECIMAL(10)
, window_wd     DECIMAL(10)
, window_ht     DECIMAL(10)
, dflt_type     DECIMAL(5)
, uiflags       DECIMAL(10)
, gridintc      DECIMAL(10)
, gridsnpc      DECIMAL(10)
, halign        DECIMAL(1)
, valign        DECIMAL(1)
, decurref_id   DECIMAL(10)
, grpmaxrow     DECIMAL(10)
, mod_date      DATE
, pers_flags    DECIMAL(3)
, must_split    DECIMAL(3)
, may_split     DECIMAL(3)
, min_trunc     DECIMAL(3)
, min_pnt_sz    DECIMAL(3)
, tmpl_name     VARCHAR(250)
, tmpl_cust     DECIMAL(1)
, mail_text     VARCHAR(250)
, text_file     VARCHAR(250)
, image_file    VARCHAR(250)
, vers_flags    VARCHAR(250)
, textesc_br    VARCHAR(250)
, textesc_ar    VARCHAR(250)
, textesc_bp    VARCHAR(250)
, textesc_ap    VARCHAR(250)
, textesc_bf    VARCHAR(250)
, textesc_af    VARCHAR(250)
, textesc_mj_id DECIMAL(10)
, fileesc_br    VARCHAR(250)
, fileesc_ar    VARCHAR(250)
, fileesc_bp    VARCHAR(250)
, fileesc_ap    VARCHAR(250)
, fileesc_bf    VARCHAR(250)
, fileesc_af    VARCHAR(250)
, fileesc_mj    VARCHAR(250)
, esctypes      DECIMAL(10)
, section_title VARCHAR(250)
, xml_tag       VARCHAR(250)
, xml_attr      VARCHAR(250)
, xml_suppress  NUMBER(1)
, prolog_type   NUMBER(1)
, text_prolog   VARCHAR(250)
, file_prolog   VARCHAR(250)
, xml_includedtd  NUMBER(1)
);

SET TERMOUT OFF;
ALTER TABLE srw2__data_model MODIFY
(
  mail_text     VARCHAR(2000)
, text_file     VARCHAR(2000)
, image_file    VARCHAR(2000)
, textesc_br    VARCHAR(2000)
, textesc_ar    VARCHAR(2000)
, textesc_bp    VARCHAR(2000)
, textesc_ap    VARCHAR(2000)
, textesc_bf    VARCHAR(2000)
, textesc_af    VARCHAR(2000)
, fileesc_br    VARCHAR(2000)
, fileesc_ar    VARCHAR(2000)
, fileesc_bp    VARCHAR(2000)
, fileesc_ap    VARCHAR(2000)
, fileesc_bf    VARCHAR(2000)
, fileesc_af    VARCHAR(2000)
, fileesc_mj    VARCHAR(2000)
, section_title VARCHAR(2000)
);
SET TERMOUT ON;

CREATE UNIQUE INDEX srw2_data_model_idx ON srw2__data_model
(
  owner
, modid
, itemid
);

CREATE VIEW srw2_data_model AS
  SELECT * 
  FROM srw2__data_model
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_data_model FOR system.srw2_data_model;




REM  +------------------------------------------------------------------------+
REM  |  SRW2_FIELD - Layout Field                                             |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__field
(
  owner      VARCHAR(30)
, modid      DECIMAL(10)
, itemid     DECIMAL(10)
, name       VARCHAR(30)
, tag        DECIMAL(10)
, disp_order DECIMAL(5)
, formatflag DECIMAL(10)
, pre_code   VARCHAR(250)
, post_code  VARCHAR(250)
, x          DECIMAL(10)
, y          DECIMAL(10)
, wd         DECIMAL(10)
, ht         DECIMAL(10)
, page       DECIMAL(5)
, pgn_flags  DECIMAL(5)
, pgn_start  DECIMAL(5)
, pgn_incr   DECIMAL(5)
, pgn_reset  DECIMAL(10)
, source_id  DECIMAL(10)
, continued  DECIMAL(10)
, alignment  DECIMAL(5)
, text_wrap  DECIMAL(2)
, min_widows DECIMAL(5)
, min_orphan DECIMAL(5)
, max_lines  DECIMAL(5)
, mask       VARCHAR(250)
, null_value VARCHAR(250)
, spacing    DECIMAL(10)
, bidi_dir   DECIMAL(5)
, pers_flags DECIMAL(3)
, group_node DECIMAL(10)
, gn_type    DECIMAL(2)
, null_ind1  DECIMAL(10)
, null_ind2  DECIMAL(10)
, null_ind3  DECIMAL(10)
, templ_id   DECIMAL(10)
, frame_id   DECIMAL(10)
);

SET TERMOUT OFF;
ALTER TABLE srw2__field MODIFY
(
  pre_code   VARCHAR(2000)
, post_code  VARCHAR(2000)
, mask       VARCHAR(2000)
, null_value VARCHAR(2000)
);
SET TERMOUT ON;

CREATE UNIQUE INDEX srw2_field_idx ON srw2__field
(
  owner
, modid
, itemid
);

CREATE VIEW srw2_field AS
  SELECT * 
  FROM srw2__field
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_field FOR system.srw2_field;






REM  +------------------------------------------------------------------------+
REM  |  SRW2_FRAME - Layout Frame/Repeating Frame                             |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__frame
(
  owner      VARCHAR(30)
, modid      DECIMAL(10)
, itemid     DECIMAL(10)
, name       VARCHAR(30)
, tag        DECIMAL(10)
, disp_order DECIMAL(5)
, formatflag DECIMAL(10)
, pre_code   VARCHAR(250)
, post_code  VARCHAR(250)
, x          DECIMAL(10)
, y          DECIMAL(10)
, wd         DECIMAL(10)
, ht         DECIMAL(10)
, page       DECIMAL(5)
, group_id   DECIMAL(10)
, continued  DECIMAL(10)
, direction  DECIMAL(5)
, min_widows DECIMAL(5)
, min_orphan DECIMAL(5)
, max_lines  DECIMAL(5)
, between_x  DECIMAL(10)
, between_y  DECIMAL(10)
, reserved   DECIMAL(10)
, bidi_dir   DECIMAL(5)
, max_cols   DECIMAL(5)
, max_rows   DECIMAL(5)
, pers_flags DECIMAL(3)
, group_node DECIMAL(10)
, gn_type    DECIMAL(2)
, null_ind1  DECIMAL(10)
, null_ind2  DECIMAL(10)
, frame_type DECIMAL(2)
, templ_id   DECIMAL(10)
);

SET TERMOUT OFF;
ALTER TABLE srw2__frame MODIFY
(
  pre_code   VARCHAR(2000)
, post_code  VARCHAR(2000)
);
SET TERMOUT ON;

CREATE UNIQUE INDEX srw2_frame_idx ON srw2__frame
(
  owner
, modid
, itemid
);

CREATE VIEW srw2_frame AS
  SELECT * 
  FROM srw2__frame
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_frame FOR system.srw2_frame;




REM  +------------------------------------------------------------------------+
REM  |  SRW2_GROUP_NODE - Template Group Node                                 |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__group_node
(
  owner        VARCHAR(30)
, modid        DECIMAL(10)
, itemid       DECIMAL(10)
, null_ind1    DECIMAL(10)
, null_ind2    DECIMAL(10)
, delta_null   DECIMAL(10)
, delta_hfr    DECIMAL(10)
, delta_vfr    DECIMAL(10)
, delta_hmd    DECIMAL(10)
, delta_vmd    DECIMAL(10)
, delta_hsb    DECIMAL(10)
, delta_vsb    DECIMAL(10)
, delta_hfl    DECIMAL(10)
, delta_vfl    DECIMAL(10)
, delta_hif    DECIMAL(10)
, delta_vif    DECIMAL(10)
, delta_hpf    DECIMAL(10)
, delta_hpg    DECIMAL(10)
, delta_vpg    DECIMAL(10)
, delta_hch    DECIMAL(10)
, delta_vch    DECIMAL(10)
, justify      DECIMAL(3)
, groupstyle   DECIMAL(3)
, placebelow   DECIMAL(3)
, fldsperline  DECIMAL(5)
, vertspace    DECIMAL(3)
, listid       DECIMAL(5)
, listpos      DECIMAL(5)
, placeabove   DECIMAL(3)
, alignsums    DECIMAL(3)
);

CREATE UNIQUE INDEX srw2_group_node_idx ON srw2__group_node
(
  owner
, modid
, itemid
);

CREATE VIEW srw2_group_node AS
  SELECT * 
  FROM srw2__group_node
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_group_node FOR system.srw2_group_node;





REM  +------------------------------------------------------------------------+
REM  |  SRW2_GROUP - Data Model Group                                         |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__group
(
  owner      VARCHAR(30)
, modid      DECIMAL(10)
, itemid     DECIMAL(10)
, name       VARCHAR(30)
, tag        DECIMAL(10)
, disp_order DECIMAL(5)
, ptag       DECIMAL(10)
, query_id   DECIMAL(10)
, parent_id  DECIMAL(10)
, qlf_type   DECIMAL(2)
, qlf_arg    DECIMAL(5)
, qlf_column DECIMAL(10)
, glf_type   DECIMAL(2)
, glf_arg    DECIMAL(5)
, glf_column DECIMAL(10)
, rlf_type   DECIMAL(2)
, rlf_arg    DECIMAL(5)
, rlf_column DECIMAL(10)
, cross_prod DECIMAL(1)
, product_id DECIMAL(10)
, num_points DECIMAL(5)
, points     RAW(250)
, x          DECIMAL(10)
, y          DECIMAL(10)
, wd         DECIMAL(10)
, ht         DECIMAL(10)
, dflt_dir   DECIMAL(5)
, pers_flags DECIMAL(3)
, mail_text  VARCHAR(250)
, xml_tag       VARCHAR(250)
, xml_attr      VARCHAR(250)
, xml_suppress  NUMBER(1)
, outer_xml_tag VARCHAR(250)
, outer_attr    VARCHAR(250)
);

SET TERMOUT OFF;
ALTER TABLE srw2__group MODIFY
(
  mail_text   VARCHAR(2000)
);
SET TERMOUT ON;

CREATE UNIQUE INDEX srw2_group_idx ON srw2__group
(
  owner
, modid
, itemid
);

CREATE VIEW srw2_group AS
  SELECT * 
  FROM srw2__group
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_group FOR system.srw2_group;





REM  +------------------------------------------------------------------------+
REM  |  SRW2_HYPERLINK - hyperlink object for layout objects                  |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__hyperlink
(
  owner        VARCHAR(30)
, modid        DECIMAL(10)
, hypl_flags   DECIMAL(5)
, object_id    DECIMAL(10)
, tag_name     VARCHAR(250)
, link_todoc   VARCHAR(250)
, linkaction   VARCHAR(250)
, out_title    VARCHAR(250)
, image_name   VARCHAR(250)
, addnl_attr   VARCHAR(250)
, html_attr    varchar(250)
);

SET TERMOUT OFF;
ALTER TABLE srw2__hyperlink MODIFY
(
  tag_name    VARCHAR(2000)
, link_todoc  VARCHAR(2000)
, linkaction  VARCHAR(2000)
, out_title   VARCHAR(2000)
, image_name  VARCHAR(2000)
, addnl_attr  VARCHAR(2000)
);
SET TERMOUT ON;

CREATE INDEX srw2_hyperlink_idx ON srw2__hyperlink
(
  owner
, modid
);

CREATE VIEW srw2_hyperlink AS
  SELECT * 
  FROM srw2__hyperlink
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_hyperlink FOR system.srw2_hyperlink;


REM  +------------------------------------------------------------------------+
REM  |  SRW2_FORMAT_EXCEPTION - format exception object for layout objects    |
REM  +------------------------------------------------------------------------+
 
CREATE TABLE srw2__format_exception
(
  owner        VARCHAR(30)
, modid        DECIMAL(10)
, object_id    DECIMAL(10)
, activate     DECIMAL(3)
, tag          DECIMAL(10)
, nullvals     DECIMAL(10)
, displayed    DECIMAL(3)
, exp_label    VARCHAR(250)
, srccol1      DECIMAL(10)
, exception1   DECIMAL(3)
, loval1       VARCHAR(250)
, hival1       VARCHAR(250)
, conjunct1    DECIMAL(3)
, srccol2      DECIMAL(10)
, exception2   DECIMAL(3)
, loval2       VARCHAR(250)
, hival2       VARCHAR(250)
, conjunct2    DECIMAL(3)
, srccol3      DECIMAL(10)
, exception3   DECIMAL(3)
, loval3       VARCHAR(250)
, hival3       VARCHAR(250)
, conjunct3    DECIMAL(3)
);
 
SET TERMOUT OFF;
ALTER TABLE srw2__format_exception MODIFY
(
  exp_label   VARCHAR(2000)
, loval1      VARCHAR(2000)
, hival1      VARCHAR(2000)
, loval2      VARCHAR(2000)
, hival2      VARCHAR(2000)
, loval3      VARCHAR(2000)
, hival3      VARCHAR(2000)
);
SET TERMOUT ON;

CREATE INDEX srw2_format_exception_idx ON srw2__format_exception
(
  owner
, modid
);
 
CREATE VIEW srw2_format_exception AS
  SELECT *
  FROM srw2__format_exception
  WHERE owner = user OR
        modid IN (SELECT modid
                  FROM tool_accessible
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;
 
CREATE PUBLIC SYNONYM srw2_format_exception FOR system.srw2_format_exception;


REM  +------------------------------------------------------------------------+
REM  |  SRW2_JAVA_APPLET - Java Applet object for layout objects              |
REM  +------------------------------------------------------------------------+
 
CREATE TABLE srw2__java_applet
(
  owner         VARCHAR(30)
, modid         DECIMAL(10)
, itemid        DECIMAL(10)
, name          VARCHAR(250)
, tag           DECIMAL(10)
, disp_order    DECIMAL(5)
, formatflag    DECIMAL(10)
, pre_code      VARCHAR(250)
, post_code     VARCHAR(250)
, x             DECIMAL(10)
, y             DECIMAL(10)
, wd            DECIMAL(10)
, ht            DECIMAL(10)
, page          DECIMAL(5)
, group_id      DECIMAL(10)
, persflag      DECIMAL(3)
, data_file_loc VARCHAR(250)
, data_file_src VARCHAR(250)
, place_id      DECIMAL(10)
, grp_top_id    DECIMAL(10)
, grp_bot_id    DECIMAL(10)
);
 
SET TERMOUT OFF;
ALTER TABLE srw2__java_applet MODIFY
(
  name          VARCHAR(2000)
, pre_code      VARCHAR(2000)
, post_code     VARCHAR(2000)
, data_file_loc VARCHAR(2000)
, data_file_src VARCHAR(2000)
);
SET TERMOUT ON;
 
CREATE INDEX srw2_java_applet_idx ON srw2__java_applet
(
  owner
, modid
, itemid
);
 
CREATE VIEW srw2_java_applet AS
  SELECT *
  FROM srw2__java_applet
  WHERE owner = user OR
        modid IN (SELECT modid
                  FROM tool_accessible
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;
 
CREATE PUBLIC SYNONYM srw2_java_applet FOR system.srw2_java_applet;
 

REM  +------------------------------------------------------------------------+
REM  |  SRW2_JAVA_PROPERTIES - Java Properties object for layout objects      |
REM  +------------------------------------------------------------------------+
 
CREATE TABLE srw2__java_properties
(
  owner          VARCHAR(30)
, modid          DECIMAL(10)
, pers_flags     DECIMAL(3)
, java_applet_id DECIMAL(10)
, property_flag  DECIMAL(10)
, name           VARCHAR(250)
, tag_id         DECIMAL(10)
, value          VARCHAR(250)
, exception      VARCHAR(250)
, lovlistid      DECIMAL(10)
);
 
SET TERMOUT OFF;
ALTER TABLE srw2__java_properties MODIFY
(
  name           VARCHAR(2000)
, value          VARCHAR(2000)
, exception      VARCHAR(2000)
);
SET TERMOUT ON;
 
CREATE INDEX srw2_java_properties_idx ON srw2__java_properties
(
  owner
, modid
);
 
CREATE VIEW srw2_java_properties AS
  SELECT *
  FROM srw2__java_properties
  WHERE owner = user OR
        modid IN (SELECT modid
                  FROM tool_accessible
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;
 
CREATE PUBLIC SYNONYM srw2_java_properties FOR system.srw2_java_properties;


REM  +-------------------------------------------------------------+
REM  |  SRW2_DISTRIBUTION - Distribution object for layout objects |
REM  +-------------------------------------------------------------+

CREATE TABLE srw2__distribution
(
  owner          VARCHAR(30)
, modid          DECIMAL(10)
, itemid         DECIMAL(10)
, distid         VARCHAR(250)
, lytype         DECIMAL(3)
, copies         DECIMAL(5)
, spool          DECIMAL(3)
, desname        VARCHAR(250)
, destype        DECIMAL(10)
, desformat      DECIMAL(10)
);

SET TERMOUT OFF;
ALTER TABLE srw2__distribution MODIFY
(
  distid         VARCHAR(2000)
, desname        VARCHAR(2000)
);
SET TERMOUT ON;

CREATE INDEX srw2_distribution_idx ON srw2__distribution
(
  owner
, modid
);

CREATE VIEW srw2_distribution AS
  SELECT *
  FROM srw2__distribution
  WHERE owner = user OR
        modid IN (SELECT modid
                  FROM tool_accessible
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_distribution FOR system.srw2_distribution;


REM  +------------------------------------------------------------------------+
REM  |  SRW2_LAYOUT_GROUP - Layout Group Header Record                        |
REM  +------------------------------------------------------------------------+
 
CREATE TABLE srw2__layout_group
(
  owner      VARCHAR(30)
, modid      DECIMAL(10)
, itemid     DECIMAL(10)
, disp_order DECIMAL(5)
, formatflag DECIMAL(10)
, nchildren  DECIMAL(10)
, pers_flags DECIMAL(3)
);
 
CREATE UNIQUE INDEX srw2_layout_group_idx ON srw2__layout_group
(
  owner
, modid
, itemid
);
 
CREATE VIEW srw2_layout_group AS
  SELECT *
  FROM srw2__layout_group
  WHERE owner = user OR
        modid IN (SELECT modid
                  FROM tool_accessible
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;
 
CREATE PUBLIC SYNONYM srw2_layout_group FOR system.srw2_layout_group;
 

REM  +------------------------------------------------------------------------+
REM  |  SRW2_LINK - Data Model Parent-Child Link                              |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__link
(
  owner      VARCHAR(30)
, modid      DECIMAL(10)
, itemid     DECIMAL(10)
, tag        DECIMAL(10)
, disp_order DECIMAL(5)
, parent_id  DECIMAL(10)
, p_column   DECIMAL(10)
, child_id   DECIMAL(10)
, c_column   DECIMAL(10)
, clause     DECIMAL(2)
, operator   DECIMAL(2)
, num_points DECIMAL(5)
, points     RAW(250)
, pers_flags DECIMAL(3)
);

CREATE UNIQUE INDEX srw2_link_idx ON srw2__link
(
  owner
, modid
, itemid
);

CREATE VIEW srw2_link AS
  SELECt * 
  FROM srw2__link
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_link FOR system.srw2_link;


REM  +------------------------------------------------------------------------+
REM  |  SRW2_LAYOUT - Layout Header Record                                    |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__layout
(
  owner           VARCHAR(30)
, modid           DECIMAL(10)
, itemid          DECIMAL(10)
, settings        DECIMAL(10)
, zoompower       DECIMAL(5)
, units           DECIMAL(2)
, orient          DECIMAL(5)
, units_wid       DECIMAL(10)
, units_hgt       DECIMAL(10)
, char_wid        DECIMAL(10)
, char_hgt        DECIMAL(10)
, body_wid        DECIMAL(10)
, body_hgt        DECIMAL(10)
, page_wid        DECIMAL(10)
, page_hgt        DECIMAL(10)
, print_wid       DECIMAL(10)
, print_hgt       DECIMAL(10)
, x_panels        DECIMAL(10)
, y_panels        DECIMAL(10)
, headers         DECIMAL(5)
, trailers        DECIMAL(5)
, window_x        DECIMAL(10)
, window_y        DECIMAL(10)
, window_wd       DECIMAL(10)
, window_ht       DECIMAL(10)
, run_flags       DECIMAL(5)
, title           VARCHAR(250)
, hint            VARCHAR(250)
, status          VARCHAR(250)
, maxheaders      DECIMAL(5)
, maxtrailers     DECIMAL(5)
, maxbody_acr     DECIMAL(5)
, maxbody_dwn     DECIMAL(5)
, intern_ver      DECIMAL(4)
, intern_ver2     DECIMAL(4)
, applstate       DECIMAL(6)
, uiflags         DECIMAL(10)
, gridintc        DECIMAL(10)
, gridsnpc        DECIMAL(10)
, halign          DECIMAL(1)
, valign          DECIMAL(1)
, rrectcnr_wd     DECIMAL(10)
, rrectcnr_ht     DECIMAL(10)
, spacing         DECIMAL(10)
, justific        DECIMAL(5)
, arrowstyle      DECIMAL(1)
, uitag           DECIMAL(10)
, nextlistid      DECIMAL(10)
, idroleslist     DECIMAL(10)
, bidi_dir        DECIMAL(5)
, pers_flags      DECIMAL(3)
, hdr_units_wid   DECIMAL(10)
, hdr_units_hgt   DECIMAL(10)
, hdr_char_wid    DECIMAL(10)
, hdr_char_hgt    DECIMAL(10)
, hdr_body_wid    DECIMAL(10)
, hdr_body_hgt    DECIMAL(10)
, hdr_page_wid    DECIMAL(10)
, hdr_page_hgt    DECIMAL(10)
, hdr_print_wid   DECIMAL(10)
, hdr_print_hgt   DECIMAL(10)
, hdr_x_panels    DECIMAL(10)
, hdr_y_panels    DECIMAL(10)
, trl_units_wid   DECIMAL(10)
, trl_units_hgt   DECIMAL(10)
, trl_char_wid    DECIMAL(10)
, trl_char_hgt    DECIMAL(10)
, trl_body_wid    DECIMAL(10)
, trl_body_hgt    DECIMAL(10)
, trl_page_wid    DECIMAL(10)
, trl_page_hgt    DECIMAL(10)
, trl_print_wid   DECIMAL(10)
, trl_print_hgt   DECIMAL(10)
, trl_x_panels    DECIMAL(10)
, trl_y_panels    DECIMAL(10)
, hdr_maxbody_acr DECIMAL(5)
, hdr_maxbody_dwn DECIMAL(5)
, trl_maxbody_acr DECIMAL(5)
, dist_overlap    DECIMAL(10)
, trl_maxbody_dwn DECIMAL(5)
);

SET TERMOUT OFF;
ALTER TABLE srw2__layout MODIFY
(
  title       VARCHAR(2000)
, hint        VARCHAR(2000)
, status      VARCHAR(2000)
);
SET TERMOUT ON;

CREATE UNIQUE INDEX srw2_layout_idx ON srw2__layout
(
  owner
, modid
, itemid
);

CREATE VIEW srw2_layout AS
  SELECT * 
  FROM srw2__layout
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_layout FOR system.srw2_layout;






REM  +------------------------------------------------------------------------+
REM  |  SRW2_BODY_LOCATION - Location of each page body  |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__body_location
(
  owner      VARCHAR(30)
, modid      DECIMAL(10)
, start_x    DECIMAL(10)
, start_y    DECIMAL(10)
, loc_order  DECIMAL(5)
, type       DECIMAL(1)
);

CREATE INDEX srw2_body_location_idx ON srw2__body_location
(
  owner
, modid
, loc_order
);

CREATE VIEW srw2_body_location AS
  SELECT * 
  FROM srw2__body_location
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_body_location FOR system.srw2_body_location;





REM  +------------------------------------------------------------------------+
REM  |  SRW2_MATRIX - Layout Matrix                                           |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__matrix
(
  owner      VARCHAR(30)
, modid      DECIMAL(10)
, itemid     DECIMAL(10)
, name       VARCHAR(30)
, tag        DECIMAL(10)
, disp_order DECIMAL(5)
, page       DECIMAL(5)
, down_id    DECIMAL(10)
, across_id  DECIMAL(10)
, group_id   DECIMAL(10)
, pers_flags DECIMAL(3)
);

CREATE UNIQUE INDEX srw2_matrix_idx ON srw2__matrix
(
  owner
, modid
, itemid
);

CREATE VIEW srw2_matrix AS
  SELECT * 
  FROM srw2__matrix
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_matrix FOR system.srw2_matrix;





REM  +------------------------------------------------------------------------+
REM  |  SRW2_OG_DOCUMENT - Layout Oracle Graphics Document/Chart              |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__og_document
(
  owner      VARCHAR(30)
, modid      DECIMAL(10)
, itemid     DECIMAL(10)
, name       VARCHAR(30)
, tag        DECIMAL(10)
, disp_order DECIMAL(5)
, formatflag DECIMAL(10)
, pre_code   VARCHAR(250)
, post_code  VARCHAR(250)
, x          DECIMAL(10)
, y          DECIMAL(10)
, wd         DECIMAL(10)
, ht         DECIMAL(10)
, page       DECIMAL(5)
, og_dname   VARCHAR(250)
, og_qname   VARCHAR(250)
, og_sloc    DECIMAL(5)
, group_id   DECIMAL(10)
, pers_flags DECIMAL(3)
, og_dtype   DECIMAL(5)
, place_id   DECIMAL(10)
, grp_top_id DECIMAL(10)
, grp_bot_id DECIMAL(10)
, og_link    VARCHAR(250)
);

SET TERMOUT OFF;
ALTER TABLE srw2__og_document MODIFY
(
  pre_code   VARCHAR(2000)
, post_code  VARCHAR(2000)
, og_dname   VARCHAR(2000)
, og_qname   VARCHAR(2000)
, og_link    VARCHAR(2000)
);
SET TERMOUT ON;

CREATE UNIQUE INDEX srw2_og_document_idx ON srw2__og_document
(
  owner
, modid
, itemid
);

CREATE VIEW srw2_og_document AS
  SELECT * 
  FROM srw2__og_document
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_og_document FOR system.srw2_og_document;





REM  +------------------------------------------------------------------------+
REM  |  SRW2_OGD_COLUMN_MAP - Layout Oracle Graphics Document Column Map      |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__ogd_column_map
(
  owner      VARCHAR(30)
, modid      DECIMAL(10)
, itemid     DECIMAL(10)
, srw_colid  DECIMAL(10)
, og_coltype DECIMAL(5)
, og_colname VARCHAR(250)
, pers_flags DECIMAL(3)
, og_colsubt DECIMAL(2)
);

SET TERMOUT OFF;
ALTER TABLE srw2__ogd_column_map MODIFY
(
  og_colname VARCHAR(2000)
);
SET TERMOUT ON;

CREATE UNIQUE INDEX srw2_ogd_column_map_idx ON srw2__ogd_column_map
(
  owner
, modid
, itemid
, srw_colid
, og_coltype
);

CREATE VIEW srw2_ogd_column_map AS
  SELECT * 
  FROM srw2__ogd_column_map
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_ogd_column_map FOR system.srw2_ogd_column_map;





REM  +------------------------------------------------------------------------+
REM  |  SRW2_PARAM_FORM - Parameter Form Header Record                        |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__param_form
(
  owner       VARCHAR(30)
, modid       DECIMAL(10)
, itemid      DECIMAL(10)
, settings    DECIMAL(10)
, zoompower   DECIMAL(5)
, units       DECIMAL(5)
, units_wid   DECIMAL(10)
, units_hgt   DECIMAL(10)
, form_wid    DECIMAL(10)
, form_hgt    DECIMAL(10)
, char_wid    DECIMAL(10)
, char_hgt    DECIMAL(10)
, window_x    DECIMAL(10)
, window_y    DECIMAL(10)
, window_wd   DECIMAL(10)
, window_ht   DECIMAL(10)
, uiflags     DECIMAL(10)
, gridintc    DECIMAL(10)
, gridsnpc    DECIMAL(10)
, halign      DECIMAL(1)
, valign      DECIMAL(1)
, rrectcnr_wd DECIMAL(10)
, rrectcnr_ht DECIMAL(10)
, spacing     DECIMAL(10)
, justific    DECIMAL(5)
, arrowstyle  DECIMAL(1)
, uitag       DECIMAL(10)
, page_tot    DECIMAL(5)
, dflt_title  VARCHAR(250)
, dflt_hint   VARCHAR(250)
, dflt_status VARCHAR(250)
, pers_flags  DECIMAL(3)
);

SET TERMOUT OFF;
ALTER TABLE srw2__param_form MODIFY
(
  dflt_title  VARCHAR(2000)
, dflt_hint   VARCHAR(2000)
, dflt_status VARCHAR(2000)
);
SET TERMOUT ON;

CREATE UNIQUE INDEX srw2_param_form_idx ON srw2__param_form
(
  owner
, modid
, itemid
);

CREATE VIEW srw2_param_form AS
  SELECT * 
  FROM srw2__param_form
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_param_form FOR system.srw2_param_form;






REM  +------------------------------------------------------------------------+
REM  |  SRW2_QUERY - Data Model Query                                         |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__query
(
  owner      VARCHAR(30)
, modid      DECIMAL(10)
, itemid     DECIMAL(10)
, name       VARCHAR(30)
, tag        DECIMAL(10)
, disp_order DECIMAL(5)
, querylfid  DECIMAL(10)
, net_logon  VARCHAR(250)
, ext_query  VARCHAR(250)
, temp_table VARCHAR(30)
, temp_flags DECIMAL(5)
, exec_freq  DECIMAL(2)
, max_rows   DECIMAL(10)
, x          DECIMAL(10)
, y          DECIMAL(10)
, wd         DECIMAL(10)
, ht         DECIMAL(10)
, pers_flags DECIMAL(3)
, dstype     DECIMAL(3)
);

SET TERMOUT OFF;
ALTER TABLE srw2__query MODIFY
(
  ext_query  VARCHAR(2000)
);
SET TERMOUT ON;

CREATE UNIQUE INDEX srw2_query_idx ON srw2__query
(
  owner
, modid
, itemid
);

CREATE VIEW srw2_query AS
  SELECT * 
  FROM srw2__query
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_query FOR system.srw2_query;






REM  +------------------------------------------------------------------------+
REM  |  SRW2_ELEMENT - Select Expression or Parameter in a Query              |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__element
(
  owner      VARCHAR(30)
, modid      DECIMAL(10)
, itemid     DECIMAL(10)
, alias      VARCHAR(250)
, expr       VARCHAR(250)
, desc_expr  VARCHAR(250)
, sel_order  DECIMAL(5)
, data_type  DECIMAL(2)
, width      DECIMAL(10)
, scale      DECIMAL(5)
, precision  DECIMAL(5)
, queryid    DECIMAL(10)
, odata_type DECIMAL(4)
, reloplst   DECIMAL(10)
, pers_flags DECIMAL(3)
);

SET TERMOUT OFF;
ALTER TABLE srw2__element modify
(
  alias      VARCHAR(2000)
, expr       VARCHAR(2000)
, desc_expr  VARCHAR(2000)
);
SET TERMOUT ON;

CREATE UNIQUE INDEX srw2_element_idx ON srw2__element
(
  owner
, modid
, itemid
);

CREATE VIEW srw2_element AS
  SELECT * 
  FROM srw2__element
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_element FOR system.srw2_element;






REM  +------------------------------------------------------------------------+
REM  |  SRW2_DISPLAY_TAG - Display Information for a Layout Object            |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__display_tag
(
  owner      VARCHAR(30)
, modid      DECIMAL(10)
, itemid     DECIMAL(10)
, cm_text    VARCHAR(250)
, cm_fill    VARCHAR(250)
, cm_bord    VARCHAR(250)
, penwid     DECIMAL(10)
, add_flags  DECIMAL(10)
, textpat    DECIMAL(5)
, textfore   DECIMAL(5)
, textback   DECIMAL(5)
, linepat    DECIMAL(5)
, linefore   DECIMAL(5)
, lineback   DECIMAL(5)
, fillpat    DECIMAL(5)
, fillfore   DECIMAL(5)
, fillback   DECIMAL(5)
, fontface   DECIMAL(5)
, fontsize   DECIMAL(5)
, fontstyle  DECIMAL(5)
, fontweight DECIMAL(5)
, charset    DECIMAL(5)
, charwidth  DECIMAL(5)
, baseline   DECIMAL(5)
, kerning    DECIMAL(5)
, dashstyle  DECIMAL(5)
, capstyle   DECIMAL(5)
, joinstyle  DECIMAL(5)
, bordstyle  DECIMAL(5)
, pers_flags DECIMAL(3)
, null_flags decimal(10)
);

SET TERMOUT OFF;
ALTER TABLE srw2__display_tag MODIFY
(
  cm_text    VARCHAR(2000)
, cm_fill    VARCHAR(2000)
, cm_bord    VARCHAR(2000)
);
SET TERMOUT ON;

CREATE UNIQUE INDEX srw2_display_tag_idx ON srw2__display_tag
(
  owner
, modid
, itemid
);

CREATE VIEW srw2_display_tag AS
  SELECT * 
  FROM srw2__display_tag
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_display_tag FOR system.srw2_display_tag;






REM  +------------------------------------------------------------------------+
REM  |  SRW2_LISTS - Lists - generally available list storage table           |
REM  +------------------------------------------------------------------------+

CREATE TABLE srw2__lists
(
  owner    VARCHAR(30)
, modid    DECIMAL(10)
, listid   DECIMAL(10)
, position DECIMAL(10)
, type     DECIMAL(1)
, ctype    VARCHAR(500)
, ntype    NUMBER
, dtype    DATE
);

CREATE INDEX srw2_lists_idx ON srw2__lists
(
  owner
, modid
, listid
);

CREATE VIEW srw2_lists AS
  SELECT *
  FROM srw2__lists
  WHERE owner = user OR 
        modid IN (SELECT modid 
                  FROM tool_accessible 
                  WHERE product='SQL*ReportWriter')
WITH CHECK OPTION;

CREATE PUBLIC SYNONYM srw2_lists FOR system.srw2_lists;


commit;

