我正在尝试让标准的vim :clist,:cope功能与vim一起工作。
具体地说,我正在尝试(但失败了)从编译器输出中捕获文件名。
我可以正常编译PL/SQL代码(当没有error =时),我可以使用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有没有人知道我怎么让它拿起文件名?
谢谢Dave Smylie
发布于 2009-09-09 20:26:01
在我看来,您使用的语法还可以。所以我要说的就是想法...
发布于 2009-09-09 19:26:36
如果您对efm或vim或您正在尝试执行的解析一无所知,我会说您可能会更幸运地执行查询来获取错误信息。查看视图user_errors以收集错误信息。使用这种方法可以更容易地以您想要的方式获取数据。
https://stackoverflow.com/questions/1392019
复制相似问题