rem
rem $Header: /s/rw/994/spam/precious/files/ACTIVE/srw20100.sql,v 1.1 1998/11/03 06:57:45 yxia Exp $
rem
rem  Copyright (c) Oracle Corporation 1991.  All Rights Reserved, Worldwide.
rem
rem  srw20100.sql - Update tables from SQLREP 2.0.9.0-6 to SQLREP 2.0.10.0
rem

set termout off;
drop view srw2_boilerplate;
drop public synonym srw2_boilerplate;

alter table srw2__boilerplate modify
(
  pre_code   varchar(2000),  /*  */
  post_code  varchar(2000),  /*  */
  linkedfile varchar(2000)   /*  */
);

set termout on;

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;

set termout off;
drop view srw2_text_segment;
drop public synonym srw2_text_segment;

alter table srw2__text_segment modify
(
  seg_text   varchar(2000)   /*  */
);

set termout on;

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;

set termout off;
drop view srw2_column;
drop public synonym srw2_column;

alter table srw2__column modify
(
  prod_order varchar(2000),  /*  */
  null_value varchar(2000),  /*  */
  input_mask varchar(2000),  /*  */
  dflt_lbl   varchar(2000)   /*  */
);

set termout on;

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;

set termout off;
drop view srw2_field;
drop public synonym srw2_field;

alter table srw2__field modify
(
  pre_code   varchar(2000),  /*  */
  post_code  varchar(2000),  /*  */
  mask       varchar(2000),  /*  */
  null_value varchar(2000)   /*  */
);

set termout on;

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;

set termout off;
drop view srw2_frame;
drop public synonym srw2_frame;

alter table srw2__frame modify
(
  pre_code   varchar(2000),  /*  */
  post_code  varchar(2000)   /*  */
);

set termout on;

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;

set termout off;
drop view srw2_layout;
drop public synonym srw2_layout;

alter table srw2__layout modify
(
  title       varchar(2000),  /*  */
  hint        varchar(2000),  /*  */
  status      varchar(2000)   /*  */
);

set termout on;

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;

set termout off;
drop view srw2_og_document;
drop public synonym srw2_og_document;

alter table srw2__og_document modify
(
  pre_code   varchar(2000),  /*  */
  post_code  varchar(2000),  /*  */
  og_dname   varchar(2000),  /*  */
  og_qname   varchar(2000)   /*  */
);

set termout on;

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;

set termout off;
drop view srw2_ogd_column_map;
drop public synonym srw2_ogd_column_map;

alter table srw2__ogd_column_map modify
(
   og_colname varchar(2000)   /*  */
);

set termout on;

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;

set termout off;
drop view srw2_param_form;
drop public synonym srw2_param_form;

alter table srw2__param_form modify
(
  dflt_title  varchar(2000),   /*  */
  dflt_hint   varchar(2000),   /*  */
  dflt_status varchar(2000)    /*  */
);

set termout on;

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;

set termout off;
drop view srw2_query;
drop public synonym srw2_query;

alter table srw2__query modify
(
  ext_query  varchar(2000)   /*  */
);

set termout on;

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;

set termout off;
drop view srw2_element;
drop public synonym srw2_element;

alter table srw2__element modify
(
  alias      varchar(2000),  /*  */
  expr       varchar(2000),  /*  */
  desc_expr  varchar(2000)   /*  */
);

set termout on;

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;

set termout off;
drop view srw2_display_tag;
drop public synonym srw2_display_tag;

alter table srw2__display_tag add
(
  transmode  decimal(5)      /*  */
);

alter table srw2__display_tag modify
(
  cm_text    varchar(2000),  /*  */
  cm_fill    varchar(2000),  /*  */
  cm_bord    varchar(2000)   /*  */
);

set termout on;

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;

set termout off
drop view srw2_module;
drop public synonym srw2_module;

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;

set termout on;
