REM
REM $Id: srw3020.sql,v 1.2 1998/12/09 09:36:26 rjfisher Exp $
REM
REM  Copyright (c) Oracle Corporation 1996.  All Rights Reserved, Worldwide.
REM
REM  srw3020.sql
REM
REM  This script is to upgrade a database which is set up for earlier 
REM  2.5.3.x report storage to 3.0.2.x. To upgrade from before-2.5.3 
REM  versions, please run other upgrade scripts first.
REM 
REM  The changes made by this script are to support the new features
REM  provided by this major new release of Developer/2000 - Reports.
REM 
REM  After running this script, do not forget to run srw2grnt.sql to grant
REM  the Reports tables to necessary users again.
REM


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



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

DROP VIEW srw2_anchor;
DROP INDEX srw2_anchor_idx;
DROP PUBLIC SYNONYM srw2_anchor;

ALTER TABLE srw2__anchor ADD
(
  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  +------------------------------------------------------------------------+

DROP VIEW srw2_boilerplate;
DROP INDEX srw2_boilerplate_idx;
DROP PUBLIC SYNONYM srw2_boilerplate;

ALTER TABLE srw2__boilerplate ADD
(
  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  +------------------------------------------------------------------------+



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

DROP VIEW srw2_button;
DROP INDEX srw2_button_idx;
DROP PUBLIC SYNONYM srw2_button;

ALTER TABLE srw2__button ADD
(
  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  +------------------------------------------------------------------------+

DROP VIEW srw2_column;
DROP INDEX srw2_column_idx;
DROP PUBLIC SYNONYM srw2_column;

ALTER TABLE srw2__column ADD
(
  pers_flags    DECIMAL(3)
);

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  +------------------------------------------------------------------------+

DROP VIEW srw2_data_model;
DROP INDEX srw2_data_model_idx;
DROP PUBLIC SYNONYM srw2_data_model;

ALTER TABLE srw2__data_model ADD
(
  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)
);

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)
);
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  +------------------------------------------------------------------------+

DROP VIEW srw2_field;
DROP INDEX srw2_field_idx;
DROP PUBLIC SYNONYM srw2_field;

ALTER TABLE srw2__field ADD
(
  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  +------------------------------------------------------------------------+

DROP VIEW srw2_frame;
DROP INDEX srw2_frame_idx;
DROP PUBLIC SYNONYM srw2_frame;

ALTER TABLE srw2__frame ADD
(
  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)
);

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  +------------------------------------------------------------------------+

DROP VIEW srw2_group;
DROP INDEX srw2_group_idx;
DROP PUBLIC SYNONYM srw2_group;

ALTER TABLE srw2__group ADD
(
  pers_flags DECIMAL(3)
, mail_text  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)
, itemid       DECIMAL(10)
, tag_name     VARCHAR(250)
, link_todoc   VARCHAR(250)
, linkaction   VARCHAR(250)
, out_title    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)
);
SET TERMOUT ON;

CREATE INDEX srw2_hyperlink_idx ON srw2__hyperlink
(
  owner
, modid
, itemid
);

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_LAYOUT_GROUP - Layout Group Header Record                        |
REM  +------------------------------------------------------------------------+

DROP VIEW srw2_layout_group;
DROP INDEX srw2_layout_group_idx;
DROP PUBLIC SYNONYM srw2_layout_group;

ALTER TABLE srw2__layout_group ADD
(
  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  +------------------------------------------------------------------------+

DROP VIEW srw2_link;
DROP INDEX srw2_link_idx;
DROP PUBLIC SYNONYM srw2_link;

ALTER TABLE srw2__link ADD
(
  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  +------------------------------------------------------------------------+

DROP VIEW srw2_layout;
DROP INDEX srw2_layout_idx;
DROP PUBLIC SYNONYM srw2_layout;

ALTER TABLE srw2__layout ADD
(
  pers_flags  DECIMAL(3)
);

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  +------------------------------------------------------------------------+




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

DROP VIEW srw2_matrix;
DROP INDEX srw2_matrix_idx;
DROP PUBLIC SYNONYM srw2_matrix;

ALTER TABLE srw2__matrix ADD
(
  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  +------------------------------------------------------------------------+

DROP VIEW srw2_og_document;
DROP INDEX srw2_og_document_idx;
DROP PUBLIC SYNONYM srw2_og_document;

ALTER TABLE srw2__og_document ADD
(
  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  +------------------------------------------------------------------------+

DROP VIEW srw2_ogd_column_map;
DROP INDEX srw2_ogd_column_map_idx;
DROP PUBLIC SYNONYM srw2_ogd_column_map;

ALTER TABLE srw2__ogd_column_map ADD
(
  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  +------------------------------------------------------------------------+

DROP VIEW srw2_param_form;
DROP INDEX srw2_param_form_idx;
DROP PUBLIC SYNONYM srw2_param_form;

ALTER TABLE srw2__param_form ADD
(
  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  +------------------------------------------------------------------------+

DROP VIEW srw2_query;
DROP INDEX srw2_query_idx;
DROP PUBLIC SYNONYM srw2_query;

ALTER TABLE srw2__query ADD
(
  pers_flags 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  +------------------------------------------------------------------------+

DROP VIEW srw2_element;
DROP INDEX srw2_element_idx;
DROP PUBLIC SYNONYM srw2_element;

ALTER TABLE srw2__element ADD
(
  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  +------------------------------------------------------------------------+

DROP VIEW srw2_display_tag;
DROP INDEX srw2_display_tag_idx;
DROP PUBLIC SYNONYM srw2_display_tag;

ALTER TABLE srw2__display_tag ADD
(
  bordstyle  DECIMAL(5)
, pers_flags DECIMAL(3)
);

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  +------------------------------------------------------------------------+


commit;

