<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: PL SQL query in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/2803409#M939397</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;There's a script from oracle to recompile all invalid PL/SQL-routines:&lt;BR /&gt;&lt;BR /&gt;$ORACLE_HOME/rdbms/admin/utlrp.sql&lt;BR /&gt;&lt;BR /&gt;This script also looks at dependencies and compile invalid object in correct order.&lt;BR /&gt;&lt;BR /&gt;Is it this what you want?&lt;BR /&gt;&lt;BR /&gt;Christian&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 12 Sep 2002 07:48:49 GMT</pubDate>
    <dc:creator>Christian Gebhardt</dc:creator>
    <dc:date>2002-09-12T07:48:49Z</dc:date>
    <item>
      <title>PL SQL query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/2803403#M939391</link>
      <description>Hi &lt;BR /&gt;&lt;BR /&gt;I have written a piece of code to compile invalid objects within a database. It works fine until I get compilation errors. Can anybody tell me how to handle the exception, and continue with the compile operation for the remainderof the objects. As you will see I have a seperate section for compiling Package bodies. The message returned is &lt;BR /&gt;Warning: PL/SQL compilation errors.&lt;BR /&gt;&lt;BR /&gt;This is my code.&lt;BR /&gt;&lt;BR /&gt;declare&lt;BR /&gt;cursor dw is&lt;BR /&gt;select  a.object_name,&lt;BR /&gt;        a.object_type,&lt;BR /&gt;        a.owner&lt;BR /&gt;from dba_objects a&lt;BR /&gt;where a.status != 'VALID';&lt;BR /&gt;v_cursor number;&lt;BR /&gt;v_numrows integer;&lt;BR /&gt;begin&lt;BR /&gt;for col_rec in dw&lt;BR /&gt;loop&lt;BR /&gt;v_cursor:= dbms_sql.open_cursor;&lt;BR /&gt;if col_rec.object_type!= 'PACKAGE BODY' then&lt;BR /&gt;dbms_sql.parse(v_cursor, ' alter '||col_rec.object_type||' '||col_rec.owner||'.'&lt;BR /&gt;||col_rec.object_name||' compile',&lt;BR /&gt;  DBMS_SQL.V7);&lt;BR /&gt;else&lt;BR /&gt;dbms_sql.parse(v_cursor, ' alter package  '||col_rec.owner||'.'||col_rec.object_&lt;BR /&gt;name||' compile body',&lt;BR /&gt;  DBMS_SQL.V7);&lt;BR /&gt;end if;&lt;BR /&gt;v_numrows:= dbms_sql.execute(v_cursor);&lt;BR /&gt;dbms_sql.close_cursor(v_cursor);&lt;BR /&gt;end loop;&lt;BR /&gt;end;&lt;BR /&gt;/</description>
      <pubDate>Tue, 10 Sep 2002 14:25:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/2803403#M939391</guid>
      <dc:creator>Dave Walley</dc:creator>
      <dc:date>2002-09-10T14:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: PL SQL query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/2803404#M939392</link>
      <description>Inside of your "end loop;" do the following:&lt;BR /&gt;--------------&lt;BR /&gt;EXCEPTION &lt;BR /&gt;  when -0000 then&lt;BR /&gt;       dbms_output.put_line('Object '||col_rec.owner||' of type '||col_rec.object_type||' did not compile');&lt;BR /&gt;  when others then&lt;BR /&gt;       dbms_output.put_line('Object '||col_rec.owner||' of type '||col_rec.object_type||' failed for '||SQLCODE);&lt;BR /&gt;--------------&lt;BR /&gt;&lt;BR /&gt;You will need to put the error number in for the -0000 (the - is needed).  &lt;BR /&gt;&lt;BR /&gt;Brian</description>
      <pubDate>Wed, 11 Sep 2002 00:22:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/2803404#M939392</guid>
      <dc:creator>Brian Crabtree</dc:creator>
      <dc:date>2002-09-11T00:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: PL SQL query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/2803405#M939393</link>
      <description>Hi,&lt;BR /&gt;This has been a while for me, so if the following is very stupid ... excuse me :-)&lt;BR /&gt;Can't you put the dbms_sql.parse statement in an "BEGIN EXCEPTION END"-block of itself ? That way you can "catch" the execption of 1 specific statement ...&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Tom</description>
      <pubDate>Wed, 11 Sep 2002 03:08:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/2803405#M939393</guid>
      <dc:creator>Tom Geudens</dc:creator>
      <dc:date>2002-09-11T03:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: PL SQL query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/2803406#M939394</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;you may consider adding the following pieces of codes in you procedure.&lt;BR /&gt;&lt;BR /&gt;at the start:&lt;BR /&gt;set serveroutput on&lt;BR /&gt;&lt;BR /&gt;at the end:&lt;BR /&gt;show errors&lt;BR /&gt;&lt;BR /&gt;"show errors" will display the errors as follows:&lt;BR /&gt;============================&lt;BR /&gt;example:&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; show errors&lt;BR /&gt;Errors for PROCEDURE INS_EMP_DEPT:&lt;BR /&gt;&lt;BR /&gt;LINE/COL ERROR&lt;BR /&gt;-------- -----------------------------------------------------------------&lt;BR /&gt;3/11     PL/SQL: SQL Statement ignored&lt;BR /&gt;3/25     PLS-00201: identifier 'SCOTT.DEPT' must be declared&lt;BR /&gt;4/1      PL/SQL: SQL Statement ignored&lt;BR /&gt;4/25     PLS-00364: loop index variable 'X' use is invalid&lt;BR /&gt;5/1      PL/SQL: SQL Statement ignored&lt;BR /&gt;5/31     PLS-00201: identifier 'SCOTT.EMP' must be declared&lt;BR /&gt;&lt;BR /&gt;============================&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;Best Regards&lt;BR /&gt;Yogeeraj</description>
      <pubDate>Wed, 11 Sep 2002 04:40:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/2803406#M939394</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2002-09-11T04:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: PL SQL query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/2803407#M939395</link>
      <description>Thank you all for your advice, but the problem I have is that no Oracle error message is returned, just the message &lt;BR /&gt;&lt;BR /&gt;Warning: PL/SQL compilation errors. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Sep 2002 08:19:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/2803407#M939395</guid>
      <dc:creator>Dave Walley</dc:creator>
      <dc:date>2002-09-11T08:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: PL SQL query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/2803408#M939396</link>
      <description>Dave,&lt;BR /&gt;&lt;BR /&gt;The errors are still there, just not being output to you.  I would suggest working using the "EXCEPTION when OTHERS then" portion, as it should allow you to bypass the procedure exiting each time it fails.  &lt;BR /&gt;&lt;BR /&gt;Brian</description>
      <pubDate>Wed, 11 Sep 2002 21:24:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/2803408#M939396</guid>
      <dc:creator>Brian Crabtree</dc:creator>
      <dc:date>2002-09-11T21:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: PL SQL query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/2803409#M939397</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;There's a script from oracle to recompile all invalid PL/SQL-routines:&lt;BR /&gt;&lt;BR /&gt;$ORACLE_HOME/rdbms/admin/utlrp.sql&lt;BR /&gt;&lt;BR /&gt;This script also looks at dependencies and compile invalid object in correct order.&lt;BR /&gt;&lt;BR /&gt;Is it this what you want?&lt;BR /&gt;&lt;BR /&gt;Christian&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Sep 2002 07:48:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/2803409#M939397</guid>
      <dc:creator>Christian Gebhardt</dc:creator>
      <dc:date>2002-09-12T07:48:49Z</dc:date>
    </item>
  </channel>
</rss>

