Oracle:构造 JMS 消息时出现问题
经过一番努力后 Oracle 高级队列和 dbms_aq 包 我遇到了另一个问题。我从 Oracle 教程复制了代码 但是当我编译这段代码时:
create or replace
procedure jms_test(msg varchar2)
is
id pls_integer;
message sys.aq$_jms_stream_message;
enqueue_options dbms_aq.enqueue_options_t;
message_properties dbms_aq.message_properties_t;
begin
message := sys.aq$_jms_stream_message.construct(0);
message.set_string_property('FROM', 'TEST');
id := message.clear_body(-1);
end;
它抱怨:
Error(9,40): PLS-00302: component 'CONSTRUCT' must be declared
Error(10,10): PLS-00302: component 'SET_STRING_PROPERTY' must be declared
Error(11,16): PLS-00302: component 'CLEAR_BODY' must be declared
我认为这段代码在程序体之外工作,因为我尝试成功了 来自 我的 JMS 队列中有什么的食谱?
我的Oracle版本是: Oracle9i 企业版版本 9.2.0.1.0 - 生产
知道可能出了什么问题吗?
After some struggle with Oracle Advanced Queuing and dbms_aq package
I encountered another issue. I copied code from Oracle tutorials
but when I compile this code:
create or replace
procedure jms_test(msg varchar2)
is
id pls_integer;
message sys.aq$_jms_stream_message;
enqueue_options dbms_aq.enqueue_options_t;
message_properties dbms_aq.message_properties_t;
begin
message := sys.aq$_jms_stream_message.construct(0);
message.set_string_property('FROM', 'TEST');
id := message.clear_body(-1);
end;
it complains with:
Error(9,40): PLS-00302: component 'CONSTRUCT' must be declared
Error(10,10): PLS-00302: component 'SET_STRING_PROPERTY' must be declared
Error(11,16): PLS-00302: component 'CLEAR_BODY' must be declared
I think this code works out of procedure body, because I tried with success
recipes from What's in my JMS queue?
My Oracle version is:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
Any idea what can be wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来像是数据库版本问题。 AQ$_JMS_STREAM_MESSAGE在10G中有构造方法,但在9i中没有。您使用什么版本的 Oracle 服务器?
Looks like a database version problem. AQ$_JMS_STREAM_MESSAGE has a construct method in 10G but not in 9i. What version of Oracle Server are you using?
看起来像是再次授予
是否:可以
从 SYS + 您的模式在 SQL*Plus 中工作吗?
请注意,SYS.AQ$_JMS_STREAM_MESSAGE 是一个数据库对象/类型,而 SYS.DBMS_AQ 是一个包
编辑
好吧...也许 TYPE 主体丢失/无效。什么是:
返回?
Looks like grants again
Does:
work in SQL*Plus from both the SYS + your schema?
Note that SYS.AQ$_JMS_STREAM_MESSAGE is a datbase object/type, whereas SYS.DBMS_AQ is a package
EDIT
Ok... maybe the TYPE body is missing / invalid. What does:
return?