set heading off
set define on
whenever sqlerror exit
prompt
prompt Logging on as Oracle Portal owner
prompt
accept connstr prompt 'Enter connection string (e.g. portal30/portal30@orcl) : '
prompt
connect &connstr
prompt
prompt B E G I N   O R A C L E   R E P O R T S   I N S T A L L
prompt
prompt Log file in rwwwvlog.txt
prompt
select '...start: '||to_char(sysdate,'Day DD Month, YYYY HH24:MI:SS') from dual;
whenever sqlerror continue
var l_verstr varchar2(10);
var l_ver    number;
execute :l_verstr := wwctx_api.get_product_version;
execute :l_verstr := wwv_standard_util.get_version;
execute :l_ver := substr(:l_verstr, 1, instr(:l_verstr, '.') - 1);
whenever sqlerror exit
set define off
spool rwwwvtmp.sql
select decode(:l_ver, 1, 'propmt Need to upgrade WebDB to 2.1 or up before install Oracle Reports Packages', 
                      2, '@2.2/rwwwvvck.sql ' || user, 
                      3, '@3.0/rwwwvfpc30.sql ' || user) from dual;
spool off
set define on
@rwwwvtmp.sql
select '...end: '||to_char(sysdate,'Day DD Month, YYYY HH24:MI:SS') from dual;
prompt
prompt D O N E   I N S T A L L
prompt
quit
