set termout off
/* Copyright (c) 1991, 1994 by Oracle Corporation.  All Rights Reserved */
/*
$Id: 
*/
/*

  NAME
	brwin160.sql    
  
  DESCRIPTION
	This script installs Oracle Query Builder system tables.

  OWNER
	dtlai

  MODIFIED
Rem     dyee       09/11/97 -  Update version to 6.0.
Rem     dtlai      11/12/96 -  Removed installation of browser_profile table.
Rem     dtlai      10/16/96 -  Update changes for 2.5. 
Rem     dtlai      04/03/95 -  . 
Rem     dtlai      03/30/95 -  . 
Rem     dtlai      03/29/95 -  Creation 
        dtlai      03/02/95 -  Creation 

*/

set lines 80
set pages 5000
set geedback off
set verify off
set heading off
REM
set echo off
set termout on
REM

PROMPT
PROMPT  Logging on as SYSTEM to perform the installation...
PROMPT
accept INPASS prompt 'Enter password for SYSTEM : ' hide
accept Connect_Str prompt  'Enter database  service name (from TNSNAMES.ORA)[LOCAL] : '
PROMPT

REM Attempt the connection...

set echo off
set termout on

connect SYSTEM/&INPASS@&Connect_Str

set termout off
set echo off
set feedback on
undef syspass

REM If we are not connected this will fail and exit

whenever sqlerror exit
set echo off
set termout off
select null from dual;
whenever sqlerror continue

set termout on

PROMPT
PROMPT       The installation options are as follows:
PROMPT
PROMPT       1.  Install the Saved Query tables.
PROMPT       2.  Exit, do not install anything.
PROMPT
PROMPT

REM	Get response...

accept selection prompt 'Please enter a selection (default is [1]): '

REM
REM     For each of the following response, the following scripts will
REM     be run:
REM          1 -> brwins60.sql
REM          2 -> exit without running any scripts
REM          The default is [1].
REM          

set termout off

spool brwtmp2.sql

select distinct decode ('&selection', '1', 'start brwins60.sql',
                                      '', 'start brwins60.sql',
                                      null) from dual;

select 'start brwxit60' from dual;

spool off


start brwtmp2.sql


