標準のvim:clist、:cope機能をvimで動作させようとしています。
具体的には、コンパイラの出力からファイル名をキャプチャしようとしています(失敗しています)。
PL / SQLコードのコンパイルは問題なく(エラーがない場合=)、エラーメッセージ、行番号、列番号を取得するerrorformatがありますが、ファイル名を取得できません(ファイルにジャンプできるようにするためにvimが必要とします)。
これは私が思いついた中で最高のエラーフォーマットです:
:set efm=%+P[%f],%E%l/%c%m,%C%m,%Z
これはコンパイラからの出力です。最初の行にファイル名しかありません(これは+ P [%f]で取得しようとしています。
出力:
[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はエラーがキャッチされたことを示しますが、ファイル名は示しません:: 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
これでファイル名を取得する方法を知っている人はいますか?
ありがとうデイブスマイリー