OJB / Oracle XE sql 调试-显示问题
我有一个 Java 应用程序,并使用 OJB 作为我的 ORM 技术。我在本地安装了 Oracle XE 来进行开发。问题是当我需要调试问题时,我喜欢查看 SQL 输出。以下是我可以通过 Oracle XE 中的“Top SQL”界面查看的 SQL 示例:
select a_bunch_of_fields
from KREW_DOC_TYP_T A0
WHERE ((UPPER(A0.DOC_TYP_NM) LIKE :1) AND A0.ACTV_IND = :2) AND A0.CUR_IND = :3
问题是我想查看真实值而不是“:1”。我似乎找不到如何配置它。我知道真正的值正在起作用,因为应用程序在大多数情况下都按预期响应(因此我正在处理错误)。
谢谢, 杰伊
I have a Java application, and use OJB as my ORM technology. I have an Oracle XE installation locally to develop against. The problem is when I need to debug a problem, I like looking at the SQL output. Here is an example of SQL I can view through the "Top SQL" interface in Oracle XE:
select a_bunch_of_fields
from KREW_DOC_TYP_T A0
WHERE ((UPPER(A0.DOC_TYP_NM) LIKE :1) AND A0.ACTV_IND = :2) AND A0.CUR_IND = :3
The problem is I would like to see the real value instead of ":1". I can't seem to find how I can configure this. I know the real values are working, because the application is responding as expected, for the most part (hence the bugs I am working on).
Thanks,
Jay
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种快速但肮脏的方法是查看提供的数据库视图(v$sql_bind_capture 和 v$sqlarea)。在下面的 SQL 中,我刚刚添加了一个 like 子句来匹配上面的 sql 语句,然后您将为每个绑定变量及其值获取一行。要针对非常具体的 SQL 语句,您需要查询的 sql_id。
输出(如果没有 SQL,结果将如下所示):
One quick and dirty way is to look in the provided database views (v$sql_bind_capture and v$sqlarea). In the SQL below, I just added a like clause to match the sql statement you have above, you will then get a row for each bind variable and it's value. To target a very specific SQL statement you want the sql_id for your query.
Output (without the SQL the result would look look something like this):