过程问题

[复制链接]
查看11 | 回复2 | 2005-2-28 12:57:00 | 显示全部楼层 |阅读模式
create procedure sp_sales_order1(in customer_id integer,in product_id integer)
result(id integer,order_date date,fin_code_id char(2),region char(7),sales_rep
integer) begin select s.id,s.order_date,s.fin_code_id,s.region,s.sales_rep
from sales_order as s,sales_order_items as i where s.cust_id=customer_id
and i.prod_id=product_id and s.id=i.id end;

以上过程为什么不能在ORACLE7。03中现实。
如果要现实该怎么办。
谢谢大家的帮助!

回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
语法都不对吧,另外只可以返回一个值,如果要返回多值的话通过包来定义集合类型
create procedure sp_sales_order1(customer_id number,product_id number)
retern pack_a.data_type
is
b_data pack_a.data_type;
begin
select s.id,s.order_date,s.fin_code_id,s.region,s.sales_rep
intob_data
from sales_order s,sales_order_items i where s.cust_id=customer_id
and i.prod_id=product_id and s.id=i.id;
return b_data;
end;
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
I am wondering whether the procedure can use the 'return' to return the data!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行