Vim errorformat / efm for PL / SQL

I'm trying to get the standard vim: clist ,: cope function working with vim.

In particular, I am trying (and failing) to grab the filename from the compiler output.

I have compilation of PL / SQL code ok (well, when there are no errors =) and I have errorformat collecting error messages, line numbers and column numbers, but I can't get it to select (which requires vim to be able to navigate to the file).

This is the best error format I could think of:

  :set efm=%+P[%f],%E%l/%c%m,%C%m,%Z   

      

This is the compiler output. It only has the filename on the first line (which I am trying to get with + P [% f].

output:

[code/voyager/db/db_source/pck_policy_2.pks]

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Sep 8 14:51:24 2009    
Copyright (c) 1982, 2005, Oracle.  All rights reserved.    
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>
Warning: Package created with compilation errors.    
SQL> Errors for PACKAGE PCK_POLICY_2:

LINE/COL ERROR
-------- --------------------------------------------------------------
21/7     PLS-00103: Encountered the symbol "EXP_PBIT_ID" when expecting
         one of the following:
         := . ) , @ % default character
         The symbol "," was substituted for "EXP_PBIT_ID" to continue.

185/1    PLS-00103: Encountered the symbol "END" when expecting one of the
         following:
         constant exception <an identifier>
         <a double-quoted delimited-identifier> table long double ref
         char time timestamp interval date binary national character
         nchar

LINE/COL ERROR
-------- -------------------------------------------------------------

SQL> Disconnected from Oracle Database 11g Enterprise Edition 

      

: clist subsequently shows that errors were found, but not filename:: CLIST

19:21 col 7 error: PLS-00103: Encountered the symbol "EXP_PBIT_ID" when expecting one of the following: := . ) , @ % default character The symbol "," was substituted for "EXP_PBIT_ID" to continue.
21:185 col 1 error: PLS-00103: Encountered the symbol "END" when expecting one of the following: constant exception <an identifier> <a double-quoted delimited-identifier> table long double ref char time timestamp interval date binary national character nchar

      

Does anyone know how I can get this to pick up the filename?

Thanks Dave Smiley

+2


source to share


2 answers


The syntax you are using looks good to me. So all I have to offer is thoughts ...



  • Even though the filenames are not displayed, can you navigate to the correct line in the shortcut window?
  • Does the compiler give any output before the filename? Have you tried% E before% + P?
  • Even if it is not the error format you are looking for, have you tried the oracle.vim plugin ?
+1


source


Knowing ANYTHING about efm or vim or this parsing you are trying to do, I would say that you might be lucky to run a query to get the error information. Check the view user_errors

to gather information about the error. It should be easier with this method to get the data the way you want.



0


source







All Articles