rem
rem $Id: srw2500.sql,v 1.1 1998/11/03 06:57:55 yxia Exp $
rem
rem  Copyright (c) Oracle Corporation 1991.  All Rights Reserved, Worldwide.
rem
rem  srw20140.sql
rem

rem  +------------------------------+
rem  |  Update to SRW2_BOILERPLATE  |
rem  +------------------------------+

drop view srw2_boilerplate;
drop index srw2_boilerplate_idx;
drop public synonym srw2_boilerplate;


alter table srw2__boilerplate add
(
  ole_lfid   decimal(10),
  ole_len    decimal(10)
);

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  |  Update to SRW2_COLUMN  |
rem  +-------------------------+

drop view srw2_column;
drop index srw2_column_idx;
drop public synonym srw2_column;


alter table srw2__column add
(
  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)
);

set termout off;
alter table srw2__column modify
(
  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  |  Update to SRW2_LAYOUT  |
rem  +-------------------------+

drop view srw2_layout;
drop index srw2_layout_idx;
drop public synonym srw2_layout;


alter table srw2__layout modify
(
  intern_ver decimal(4)
);

alter table srw2__layout add 
( 
  nextlistid      decimal(10),     /* next list id      */
  idroleslist     decimal(10)     /* id of roles list  */
);

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  |  Create SRW2_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)    /*  */
);

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_LISTS - Lists - generally available list storage table  |
rem  +---------------------------------------------------------------+

create table srw2__lists
(
  owner    varchar(30),     /* Module Owner                */
  modid    decimal(10),     /* Module ID                   */
  listid   decimal(10),     /* Id of list                  */
  type     decimal(1),      /* Datatype of element         */
  ctype    varchar(250),    /* Element value (if string)   */
  ntype    number,          /* Element value (if number)   */
  dtype    date             /* Element value (if 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;
