显示 Oracle AQ SYS.AQ$_JMS_TEXT_MESSAGE 的内容
我有一个使用 Oracle 高级队列的 JMS op top 的应用程序。 我想对显示消息内容的队列表进行查询(在我的例子中是 XML)。 因此,当我执行“从 [queue_table] 选择 user_data”时,我得到“AQ SYS.AQ$_JMS_TEXT_MESSAGE”作为响应。
有没有一个函数可以显示这条消息的内容? 类似“从 [queue_table] 选择 FUNCTION(user_data)”之类的东西?
我用谷歌搜索,扫描了大量有关排队的 Oracle 文章,但我找不到这个东西。 我怀疑有一种简单的方法可以做到这一点,但我找不到它。
I have an application that uses JMS op top of Oracle advanced queuing. I would like to do a query on the queue table that shows the content of the message (which in my case is XML). So when I do a 'select user_data from [queue_table]' I get 'AQ SYS.AQ$_JMS_TEXT_MESSAGE' as a response.
Is there a function so that the contents of this message can be shown? Something like 'select FUNCTION(user_data) from [queue_table]' or something?
I googled, scanned numerous Oracle articles about queuing, but I cannot find this thing. I suspect there is a simple way to do this, but I cannot find it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我也在这个问题上挣扎过。 我在这里写了一个答案: http://rwijk .blogspot.com/2009/02/whats-in-my-jms-queue.html。
问候,
抢。
I struggled with this one as well. I've written an answer here: http://rwijk.blogspot.com/2009/02/whats-in-my-jms-queue.html .
Regards,
Rob.
所以我想应该是:
So I suppose it should be:
这里的答案不处理存储在
user_data.text_lob
中的较大内容的显示。如果内容大于一定数量的字节(4000?),则
text_vc
将为null
并且您必须查看text_lob
(其中否则将为null
)为了显示所有数据,无论其大小如何,您可以使用以下查询
nvl
:从 [queue_table] 中选择 nvl(q.user_data.text_vc, q.user_data.text_lob) ] q
我想你可以(并且应该考虑)使用
coalesce
而不是nvl
,因为它 如果第一个参数已经与null
不同,则不会评估第二个参数,但我还没有测试过该参数。The answers here don't handle the display of larger contents, stored in
user_data.text_lob
.If the content is larger than a certain amount of bytes (4000?),
text_vc
will benull
and you have to look attext_lob
(which would benull
otherwise)In order to show all data, regardless it's size, you could use the following query using
nvl
:SELECT nvl(q.user_data.text_vc, q.user_data.text_lob) FROM [queue_table] q
I guess you could (and should consider to) use
coalesce
instead ofnvl
, because it doesn't evaluate the second argument, if the first one is already different tonull
, but I haven't tested that one yet.除了stuXnet的注释:
如果没有to_clob,对于大于4000个字符的数据,您将得到ORA-22835,因为它保留了第一个参数的空间,该参数只是VARCHAR2。
Addition to the comment of stuXnet:
without to_clob you will get ORA-22835 for data larger than 4000 chars because it preserves the space of the first argument, which is only VARCHAR2.
我知道这个问题确实很老,但这是我搜索的第一行
对我来说是
表名.用户数据.有效负载
I know this question is really old but it was the fist line of my search
For me it is
table_name.user_data.payload
请尝试以下命令:
select user_data from [queue_table] name
Please try the following command:
select user_data from [queue_table] name