rem File:        $RCSfile: WSGL.SQL $
rem Author:      $Author: ipenning $
rem Date:        $Date: 2000/10/26 15:36:40 $
rem Version:     $Revision: 1.15 $
rem Status:      $State: Exp $
rem Locked_by:   $Locker:  $
rem Description: <Enter global description here>
rem Notes:       <Global notes>
rem Copyright:   (c) Oracle Corporation 1994.  All Rights Reserved.
rem
rem ----------------------------------------------------------------------------
rem  

column LABEL new_value LABEL_VALUE noprint 
column TEXT format A50 word_wrap 
column TYPE format A2
column POSITION heading 'COL' format 999
column LINE format 99999
define LABEL_VALUE = 'There were no errors'
set    feedback off
set    linesize 96
set scan on
set serveroutput on

accept usern CHAR prompt 'Please enter connect string for toolkit user: '
connect &&usern
set scan off
prompt Spooling to wsgl.log
spool wsgl.log
@@cdsaper.pks
@@cdsaper.pkb
@@wsglm.pks
@@wsgjsl.pks
@@wsgfl.pks
@@wsgl.pks
@@wsgjsl.pkb
@@wsgl.pkb
@@wsgfl.pkb
@@wsgoc.pks
@@wsgoc.pkb

declare
    first_mess      boolean := true;
    first_mess2     boolean := true;
    pn              varchar2(20);
    procedure make_syn( p_syn in varchar2 )
    is
        c1  integer;
    begin
        c1 := dbms_sql.open_cursor;
        dbms_sql.parse( c1, 'create public synonym '||p_syn||' for '||p_syn, dbms_sql.native );
        dbms_sql.close_cursor( c1 );
    exception when others then
        if SQLCODE = -1031 then
            if first_mess2 then
                dbms_output.put_line('This user does not have CREATE PUBLIC SYNONYM system privilege.');
                first_mess2 := false;
            end if;
        elsif SQLCODE = -955 then
            if first_mess then
                dbms_output.put_line('The following synonyms already exist. Please check that they are valid: ');
                first_mess := false;
            end if;
            dbms_output.put_line( p_syn );
        else
            dbms_output.put_line( SQLERRM );
        end if;
        dbms_sql.close_cursor( c1 ); 
    end;
begin
    pn := 'OWA';
    make_syn( pn );
    pn := 'OWA_UTIL';
    make_syn( pn );
    pn := 'OWA_COOKIE';
    make_syn( pn );
    pn := 'OWA_IMAGE';
    make_syn( pn );
    pn := 'OWA_INIT';
    make_syn( pn );
    pn := 'OWA_OPT_LOCK';
    make_syn( pn );
    pn := 'OWA_PATTERN';
    make_syn( pn );
    pn := 'OWA_SEC';
    make_syn( pn );
    pn := 'OWA_TEXT';
    make_syn( pn );
    pn := 'HTP';
    make_syn( pn );
    pn := 'HTF';
    make_syn( pn );
    pn := 'CG$ERRORS';
    make_syn( pn );
    pn := 'WSGL';
    make_syn( pn );
    pn := 'WSGJSL';
    make_syn( pn );
    pn := 'WSGLM';
    make_syn( pn );
    pn := 'WSGFL';
    make_syn( pn );
end;
/

ttitle skip 2 center 'Webserver Generator Compilation Report' skip 1 -
              center '--------------------------------------' skip 1

set heading off
select null from dual
/
ttitle off
set heading on
break on name on type

select
  '' LABEL,
  name,
  decode (type,'PACKAGE BODY','PB','PACKAGE SPEC','PS',type) TYPE,
  line, 
  position,
  text
from
  user_errors
where
  name in ('WSGLM', 'WSGJSL', 'WSGL', 'WSGFL')
order by
  NAME,
  TYPE,
  SEQUENCE
/

set scan on
prompt &&LABEL_VALUE
prompt

spool off

--exit

rem  
rem ----------------------------------------------------------------------------
rem $$Header_is_done
rem  End of file $RCSfile: WSGL.SQL $
rem ----------------------------------------------------------------------------


