0 Replies Latest reply on Jan 4, 2018 12:43 PM by frankrwahl

    17.4 Compile errors are not displayed when compiling source files as a proxy user

    frankrwahl

      This issue might be related to 17.3.1 package compile "show errors" not returning errors  and Cannot view PL/SQL compilation errors in Version 4.1.5.21

       

      The problem is that when compiling source files in the code editor, no errors are displayed when I connect as a proxy user.

      This is an annoying bug, since I am dependent on compiling packages from files (.pks/.pkb).

      However, there are a few not optimal workarounds:

       

      One workaround is to manually run a query against the USER_ERRORS view after compilation to check for errors.

      Another option is to open up the package from the Navigator and compile. Then the compile errors are displayed.

       

      It seems to me that the reason for the compilation errors not showing up, is that the query SQL Developer runs to check for compilation errors (against the ALL_ERRORS view) returns no rows.

       

      Here are the details:

       

      Version 17.4.0.355

      Connects as a proxy user FRANK_PROXY to schema SCOTT, i.e. as frank_proxy[scott]

       

      1) I open up a file, mypackage.pkb, in the code editor, make a deliberate typo and compile.

      The Log>Messages says just "Compiled", but the expected error messages (and the Log>Compiler tab) are not displayed!

       

      The statements log shows that the following SQL was run by SQL Developer with the following parameters: "OWNER"="FRANK_PROXY", "TYPE"="PACKAGE BODY", "NAME"="MYPACKAGE":

       

          SELECT LINE, POSITION, REPLACE(TEXT, CHR(10), ' '), attribute

          FROM SYS.ALL_ERRORS A

          WHERE A.NAME = :NAME AND A.TYPE = :TYPE AND A.OWNER = :OWNER

          ORDER BY ATTRIBUTE, LINE, POSITION -- errors first

       

      This query will of course return no rows since I am not the owner of the package.

      Replacing parameter OWNER with 'SCOTT', will however do the trick:

       

      LINE POSITION REPLACE(TEXT,CHR(10),'') ATTRIBUTE

      273 31 PLS-00103: Encountered the symbol ... ERROR

      273 66 PLS-00103: Encountered the symbol ...  ERROR

       

      2) If I open up the MYPACKAGE body from the Navigator and compiles, the errors show up in a separate Log>Compiler tab (as expected).

       

      According to the statement log, SQL Developer was running the same query from ALL_ERRORS as shown above, but this time with SCOTT as owner. In addition, SQL Developer was also running a query from USER_ERRORS. Both queries returns rows (error messages):

       

      265 frank_proxy[scott]@TEST 5 SELECT LINE,POSITION,TEXT,ATTRIBUTE FROM USER_ERRORS WHERE TYPE=? AND NAME=? 1="PACKAGE BODY", 2="MYPACKAGE"

       

      276 frank_proxy[scott]@TEST 11 SELECT LINE, POSITION, REPLACE(TEXT, CHR(10), ' '), attribute FROM SYS.ALL_ERRORS A WHERE A.NAME = :NAME AND A.TYPE = :TYPE AND A.OWNER = :OWNER ORDER BY ATTRIBUTE, LINE, POSITION -- errors first "OWNER"="SCOTT", "TYPE"="PACKAGE BODY", "NAME"="MYPACKAGE"