我试图获得标准的vim:clist,:应对vim的功能。
具体来说,我正在尝试(并且失败)从编译器输出中捕获文件名。
我有PL / SQL代码编译正常(好吧,没有错误=),我有错误格式提取错误消息,行号和列号,但我无法选择它文件名(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
有谁知道如何让它拿起文件名?
由于 Dave Smylie
答案 0 :(得分:1)
您正在使用的语法看起来不错。所以我所要提供的只是想法......
答案 1 :(得分:0)
知道关于efm或vim的NOTHING或者你正在尝试的这种解析,我会说你可能会更好地运行查询以获取错误信息。看看视图
user_errors
收集错误信息。使用此方法以您希望的方式获取数据应该更容易。