Oracle的call statement的用法请教!

CathySun118 2008-08-26 10:57:11
在oracle的call statement的语法结构中有条object_access_expression的子clause,不知道这个子clause如何用,
恳请有各位指点一下,非常感谢
...全文
336 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
CathySun118 2008-08-27
  • 打赏
  • 举报
回复
Ask for help!!!
CathySun118 2008-08-26
  • 打赏
  • 举报
回复
楼上的连接我看过:
只有routine_clause这条路径的例子,没有object_access_expression的例子,请给出call object_access_expression的示例,谢谢!
vc555 2008-08-26
  • 打赏
  • 举报
回复
http://www.acs.ilstu.edu/docs/oracle/server.101/b10759/statements_4008.htm
这里讲得很清楚。
CathySun118 2008-08-26
  • 打赏
  • 举报
回复
还是非常感谢,期待高人
vc555 2008-08-26
  • 打赏
  • 举报
回复
只有帮你顶了。
我也在现学,这个例子不好举。
CathySun118 2008-08-26
  • 打赏
  • 举报
回复
谢谢VC555!
但我感觉这个是第一条路径吧.
第二条路径中有 table_alias 和 ( expr )这两条路径,能举个例子吗?
非常感谢
vc555 2008-08-26
  • 打赏
  • 举报
回复
这个就是第二条路径了:

Calling a Procedure Using an Expression of an Object Type: Example

The following examples show how call a procedure by using an expression of an object type in the CALL statement. The example uses the warehouse_typ object type in the order entry sample schema OE:

ALTER TYPE warehouse_typ
ADD MEMBER FUNCTION ret_name
RETURN VARCHAR2
CASCADE;

CREATE OR REPLACE TYPE BODY warehouse_typ
AS MEMBER FUNCTION ret_name
RETURN VARCHAR2
IS
BEGIN
RETURN self.warehouse_name;
END;
END;
/
VARIABLE x VARCHAR2(25);

CALL warehouse_typ(456, 'Warehouse 456', 2236).ret_name()
INTO :x;

PRINT x;
X
--------------------------------
Warehouse 456

The next example shows how to use an external function to achieve the same thing:

CREATE OR REPLACE FUNCTION ret_warehouse_typ(x warehouse_typ)
RETURN warehouse_typ
IS
BEGIN
RETURN x;
END;
/
CALL ret_warehouse_typ(warehouse_typ(234, 'Warehouse 234',
2235)).ret_name()
INTO :x;

PRINT x;

X
--------------------------------
Warehouse 234
vc555 2008-08-26
  • 打赏
  • 举报
回复
我看了下,有例子啊。
我看了下看它的定义:If you have an expression of an object type, you can use this form of expression to call a routine defined within the type.好像就是用来调用有自定义类型的那种函数或过程吧。
你看文档中间的链接:
------------------------------------------------------------
See Also:

"Object Access Expressions " for syntax and semantics of this form of expression, and "Calling a Procedure Using an Expression of an Object Type: Example" for an example of calling a routine using an expression of an object type
------------------------------------------------------------

17,140

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧