rem 
rem $Id: gcbild.sql,v 1.1 1998/01/02 23:08:49 bgutierr Exp $
rem 
Rem  Copyright (c) 1992 by Oracle Corporation 
Rem    NAME
Rem      gcbld.sql - Graphical Chart Schema.
Rem    DESCRIPTION
Rem      Contains sql/plus calls to CREATE and INDEX the ROS tables.
Rem    RETURNS
Rem      Nothing.
Rem    NOTES
Rem    MODIFIED   (MM/DD/YY)
Rem     ewong      03/30/93 -  Removed exit statement 
Rem     fpun       01/13/93 -  change schema - add char set 
Rem     fpun       01/02/93 -  change the schema. upgrade to 2.0.6 
Rem     fpun       12/04/92 -  add exit; 
Rem     fpun       12/02/92 -  Creation 
Rem     fpun       11/24/92 -  del "set termout off" 
Rem     fpun       11/24/92 -  Creation 
Rem     ewong      11/13/92 -  Changed chartname in ref to char type 
Rem     ewong      11/05/92 -  Changed char to raw 
Rem     dlai       05/26/92 -  revise 
Rem     dlai       05/26/92 -  revise 
Rem     rquach     02/24/92 -  add views to GC tables. 
Rem     rquach     02/10/92 -  Creation 


/*--------------------------*/
/* Define gc charting table */
/*--------------------------*/
create table gc__charting (
  owner       	varchar(30),    /* owner ID */
  modid       	integer,        /* module ID */
  itemid      	integer,        /* instance ID */
  chartname_cs	integer,        /* chart name char. set */
  chartname_len	integer,	/* chart name length */
  chartname	raw(255),       /* chart name */
  chart_type	integer,	/* chart type */
  chart_vis	integer,        /* chart visibilty flag */
  depth_size	integer,        /* depth size (0 => 2D) */
  shadow_size	integer,        /* shadow size (0 => no shadow */
  shadow_dir	integer,        /* shadow direction */
  baseln_flg	integer,        /* baseline definition flag */
  baseln_dat    date,		/* baseline date value */
  baseln_val	float,          /* baseline value */
  category_wd	float,		/* category total width (frac. of strip wd) */
  baseln_axis	integer,        /* baseline axis mapping (y1 or y2) */
  x1_axis_type	integer,        /* axis data type: cont, date, or discr */
  x1_scale_fnc	integer,        /* scale function: linear, log, pct */
  x1_axis_pos 	integer,        /* axis position: top/bottom/left/right */
  x1_grid_vis 	integer,	/* major/minor tic/grid visibility bit mask */
  x1_axis_step 	integer,        /* user-fixed min/max/step bit flag */
  X1_MIN_CAT    integer,        /* New for 2.5 */
  X1_MAX_CAT    integer,        /* New for 2.5 */
  x1_cont_ax_mn	float,	        /* continuous axis min. */
  x1_cont_ax_mx float,          /* continuous axis max. */
  x1_cont_ax_st	float,          /* continuous axis step */
  x1_date_ax_mn	date,      	/* date axis min. */
  x1_date_ax_mx	date,      	/* date axis max. */
  x1_date_ax_st	integer,        /* date axis step */
  X1_CUST_LABEL_CS      integer,        /* New for 2.5 */
  X1_CUST_LABEL_LEN     integer,        /* New for 2.5 */
  X1_CUST_LABEL         raw(255),       /* New for 2.5 */
  x1_tic_type 	integer,        /* tic type (centered, in, out) */
  x1_minor_tic 	integer,        /* minor tic/grid count 0..9 */
  x1_num_format	    raw(255),   /* numeric format string for tic labels */
  x1_num_format_cs  integer,    /* numeric format char set for tic labels */
  x1_num_format_len integer,    /* numeric format char len for tic labels */  
  x1_dat_format_cs  integer,    /* date format char set for tic labels */
  x1_dat_format_len integer,    /* date format char len for tic labels */
  x1_dat_format	    raw(255),   /* date format string for tic labels */
  x1_tic_rot	integer,	/* tic label orientation (rotation) */
  x1_tic_fix	integer,	/* tic label fixed orientation flag */
  x1_tic_dt_vis	integer,	/* date labeled axis tic label visibility */
  x1_date_abbr 	integer,	/* date abbreviated flags */
  x1_wkend_flg 	integer,	/* no weekend flag */
  x1_start_mnth	integer,	/* starting month of fiscal year (1..2) */
  x1_pct_typ 	integer,	/* percent type (sum, min or max) */
  x1_pct_grp 	integer,	/* percent grouping (column or category) */
  x2_axis_type	integer,        /* axis data type: cont, date, or discr */
  x2_scale_fnc	integer,        /* scale function: linear, log, pct */
  x2_axis_pos 	integer,        /* axis position: top/bottom/left/right */
  x2_grid_vis 	integer,	/* major/minor tic/grid visibility bit mask */
  x2_axis_step 	integer,        /* user-fixed min/max/step bit flag */
  x2_cont_ax_mn	float,	        /* continuous axis min. */
  x2_cont_ax_mx float,          /* continuous axis max. */
  x2_cont_ax_st	float,          /* continuous axis step */
  x2_date_ax_mn	date,      	/* date axis min. */
  x2_date_ax_mx	date,      	/* date axis max. */
  x2_date_ax_st	integer,        /* date axis step */
  X2_CUST_LABEL_CS      integer,        /* New for 2.5 */
  X2_CUST_LABEL_LEN     integer,        /* New for 2.5 */
  X2_CUST_LABEL         raw(255),      /* New for 2.5 */
  x2_tic_type 	integer,        /* tic type (centered, in, out) */
  x2_minor_tic 	integer,        /* minor tic/grid count 0..9 */
  x2_num_format	    raw(255),   /* numeric format string for tic labels */
  x2_num_format_cs  integer,    /* numeric format char set for tic labels */
  x2_num_format_len integer,    /* numeric format char len for tic labels */  
  x2_dat_format	    raw(255),   /* date format string for tic labels */
  x2_dat_format_cs  integer,    /* date format char set for tic labels */
  x2_dat_format_len integer,    /* date format char len for tic labels */
  x2_tic_rot	integer,	/* tic label orientation (rotation) */
  x2_tic_fix	integer,	/* tic label fixed orientation flag */
  x2_tic_dt_vis	integer,	/* date labeled axis tic label visibility */
  x2_date_abbr 	integer,	/* date abbreviated flags */
  x2_wkend_flg 	integer,	/* no weekend flag */
  x2_start_mnth	integer,	/* starting month of fiscal year (1..2) */
  x2_pct_typ 	integer,	/* percent type (sum, min or max) */
  x2_pct_grp 	integer,	/* percent grouping (column or category) */
  x3_axis_type	integer,        /* axis data type: cont, date, or discr */
  x3_scale_fnc	integer,        /* scale function: linear, log, pct */
  x3_axis_pos 	integer,        /* axis position: top/bottom/left/right */
  x3_grid_vis 	integer,	/* major/minor tic/grid visibility bit mask */
  x3_axis_step 	integer,        /* user-fixed min/max/step bit flag */
  x3_cont_ax_mn	float,	        /* continuous axis min. */
  x3_cont_ax_mx float,          /* continuous axis max. */
  x3_cont_ax_st	float,          /* continuous axis step */
  x3_date_ax_mn	date,      	/* date axis min. */
  x3_date_ax_mx	date,      	/* date axis max. */
  x3_date_ax_st	integer,        /* date axis step */
  X3_CUST_LABEL_CS      integer,        /* New for 2.5 */
  X3_CUST_LABEL_LEN     integer,        /* New for 2.5 */
  X3_CUST_LABEL         raw(255),      /* New for 2.5 */
  x3_tic_type 	integer,        /* tic type (centered, in, out) */
  x3_minor_tic 	integer,        /* minor tic/grid count 0..9 */
  x3_num_format	    raw(255),   /* numeric format string for tic labels */
  x3_num_format_cs  integer,    /* numeric format char set for tic labels */
  x3_num_format_len integer,    /* numeric format char len for tic labels */  
  x3_dat_format	    raw(255),   /* date format string for tic labels */
  x3_dat_format_cs  integer,    /* date format char set for tic labels */
  x3_dat_format_len integer,    /* date format char len for tic labels */
  x3_tic_rot	integer,	/* tic label orientation (rotation) */
  x3_tic_fix	integer,	/* tic label fixed orientation flag */
  x3_tic_dt_vis	integer,	/* date labeled axis tic label visibility */
  x3_date_abbr 	integer,	/* date abbreviated flags */
  x3_wkend_flg 	integer,	/* no weekend flag */
  x3_start_mnth	integer,	/* starting month of fiscal year (1..2) */
  x3_pct_typ 	integer,	/* percent type (sum, min or max) */
  x3_pct_grp 	integer,	/* percent grouping (column or category) */
  p_clock_flg 	integer,        /* clockwise flag */
  p_sum_flg 	integer,	/* sum flag */
  p_tic_vis 	integer,	/* tic/label visibility bit mask */
  P_PREV_OLP            integer,        /* New for 2.5 */
  P_OTHER_FLAG          integer,        /* New for 2.5 */
  P_OTHER_THRESH        float,        /* New for 2.5 */
  p_fixed_sum 	float,	        /* user-fixed sum */
  p_fixed_pct 	float,	        /* user-fixed percentage */
  p_cat_lbl_fmt	    raw(255),	/* category label format string */
  p_cat_lbl_fmt_cs  integer,	/* category label format char set*/
  p_cat_lbl_fmt_len integer,	/* category label format string len*/
  p_dat_lbl_fmt	    raw(255),	/* date label format string */
  p_dat_lbl_fmt_cs  integer,	/* date label format char set */
  p_dat_lbl_fmt_len integer,	/* date label format string len*/
  p_abs_lbl_fmt	    raw(255),	/* absolute label format string */
  p_abs_lbl_fmt_cs  integer,	/* absolute label format char set */
  p_abs_lbl_fmt_len integer,	/* absolute label format string len */
  p_pct_lbl_fmt	    raw(255),	/* percent label format string */
  p_pct_lbl_fmt_cs  integer,	/* percent label format char set */
  p_pct_lbl_fmt_len integer,	/* percent label format string len*/
  T_MIN_ROWS            integer, /* NEW for 2.5 */
  t_max_row 	integer,	/* max. number of rows */
  t_max_row_fix	integer,	/* max rows fixed flag */
  t_grid_vis	integer,	/* grid visibility flags */
  t_table_dir 	integer,        /* table direction */
  t_row_pergrid	integer,	/* rows per horizontal grid line */
  l_num_col 	integer,	/* legend: number of columns */
  CHANGED       integer,        /* NEW for 2.5 */
  DIRTY         integer,        /* NEW for 2.5 */
  X1_TIC_LB_VIS         integer,        /* NEW for 2.5 */            
  X2_TIC_LB_VIS         integer,        /* NEW for 2.5 */            
  X3_TIC_LB_VIS         integer,        /* NEW for 2.5 */             
  T_MAX_ROWS            integer,        /* NEW for 2.5 */   
  l_shadow_size	integer,	/* *OBSOLETE* legend: shadow size (0 => no shadow) */
  x1_axis_dep	integer,        /* **OBSOLETE** axis dependency state: true if dep. */
  x1_ax_lbl_hs	integer,        /* *OBSOLETE* axis label hide/show flag */
  x1_num_strip 	integer,        /* *OBSOLETE*  number of strips on discrete axis */
  x2_axis_dep	integer,        /* *OBSOLETE* axis dependency state: true if dep. */
  x2_num_strip 	integer,        /* *OBSOLETE* number of strips on discrete axis */        
  x2_ax_lbl_hs	integer,        /* *OBSOLETE* axis label hide/show flag */
  x3_axis_dep	integer,        /* *OBSOLETE* axis dependency state: true if dep. */
  x3_num_strip 	integer,        /* *OBSOLETE* number of strips on discrete axis */
  x3_ax_lbl_hs	integer         /* *OBSOLETE* axis label hide/show flag */
);

create index igc_charting on gc__charting
(
  owner, modid, itemid
);

create view gc_charting as
   select * from gc__charting
   where owner = user or modid in (select modid from tool_accessible)
   with check option;

create public synonym gc_charting for system.gc_charting;

/*-----------------------*/
/* Define gc field table */
/*-----------------------*/

create table gc__field (
  owner    	varchar(30),    /* owner ID */
  modid    	integer,        /* module ID */
  itemid   	integer,        /* instance ID */
  template_seq 	integer,	/* field template order(sequence) number */
  fieldname 	raw(255),	/* field template name */
  fieldname_len	integer,	/* field template name length */
  fieldname_cs 	integer,	/* field template name char. set */
  plot_def 	integer,	/* plot definition bit mask */
  connect_type 	integer,	/* connector type */
  plot_ext 	integer,	/* plot extent */
  regress_tst 	integer,	/* regression type */
  rot_col_flag 	integer,	/* rotate colors/patterns flag */
  label_rot_ang integer,	/* label rotation angle */
  bar_overlap 	float,	        /* bar overlap (frac of bar wd) */
  num_format 	 raw(255),	/* numeric format string for text/annotation */
  num_format_cs  integer,	/* numeric format char set for text/annotation*/
  num_format_len integer,	/* numeric format len for text/annotation */
  dat_format 	 raw(255),	/* date format str for text/annotation */
  dat_format_cs  integer,	/* date format cs for text/annotation */
  dat_format_len integer,	/* date format len for text/annotation */
  axis_mapping 	integer		/* axis mapping */
);

create index igc_field on gc__field
(
  owner, modid, itemid
);

create view gc_field as
   select * from gc__field
   where owner = user or modid in (select modid from tool_accessible)
   with check option;

create public synonym gc_field for system.gc_field;

/*---------------------------*/
/* Define gc reference table */
/*---------------------------*/

create table gc__reference (
  owner    	varchar(30),    /* owner ID */
  modid    	integer,        /* module ID */
  itemid   	integer,        /* instance ID */
  refline_id 	integer,	/* reference line id */
  refline_map 	integer,        /* reference line mapping */
  cont_axis_val	float,	        /* cont. axis value mapping for this line */
  date_axis_val	date,		/* date axis value mapping for this line */
  leg_lbl 	raw(255),	/* legend label string */
  leg_lbl_len	integer,	/* legend label string length */
  leg_lbl_cs 	integer		/* legend label string char. set */
);

create index igc_reference on gc__reference
(
  owner, modid, itemid
);

create view gc_reference as
   select * from gc__reference
   where owner = user or modid in (select modid from tool_accessible)
   with check option;

create public synonym gc_reference for system.gc_reference;
