1.在数据库中创建包,语法:
create or replace package P_DATASET is
type dataset is ref cursor;
end P_DATASET;
2.在数据库库存创建视图,语法:
create or replace view v_yieldsales as
select a.y,
c.branch_name as org_code,
b.product_name,
b.full_name,
a.act_quantity,
a.act_sales
from indust_yss_day a, products_info b,branch_info c
where a.cig_spec_code = b.product_id
and a.y in (2005, 2006)
and a.act_quantity > 700
and a.act_sales > 700
and a.org_code=c.branch_id;
3.在数据库中创建存储过程,语法:
create or replace procedure P_TRENDSGROUP(i_arg1 varchar2,
i_arg2 varchar2,
i_arg3 varchar2,
i_arg4 varchar2,
ds out P_DATASET.dataset) is
v_arg1 varchar2(100);
v_arg2 varchar2(100);
v_arg3 varchar2(100);