怎么把这个储存过程中的语句改为视图
@IdleMan 你好,想跟你请教个问题:
create or replace procedure pro_guanggaozhu (ad_name_ in varchar2, start_date_ in date, over_date_ in date, resultSet out sys_refcursor) is ad_name_temp varchar2(50); start_date_temp date; over_date_temp date; begin if ad_name_='' or ad_name_ is null then ad_name_temp:='_'; else ad_name_temp:=ad_name_; end if; if start_date_='' or start_date_ is null then start_date_temp:='_'; else start_date_temp:=start_date_; end if; if over_date_='' or over_date_ is null then over_date_temp:='_'; else over_date_temp:=over_date_; end if; open resultSet for SELECT A.START_TIME AS ATIME, A.AD_NAME AS ANAME, COUNT(IMSI) AS USER_COUNT, COUNT(CASE WHEN OPERATOR_TYPE = '3' OR OPERATOR_TYPE = '4' THEN 1 END) AS DJCOUNT, COUNT(CASE WHEN OPERATOR_TYPE = '0' OR OPERATOR_TYPE = '1' THEN 1 END) AS ZSCOUNT FROM ORIGINAL_DATA OD INNER JOIN ADVERT A ON OD.AD_ID = A.ID WHERE A.AD_NAME LIKE '%'||ad_name_temp||'%' GROUP BY A.AD_NAME, A.START_TIME; end pro_guanggaozhu;
怎么将游标后的SQL语句改成外部创建的带参数的视图,然后放进来。这里的参数暂时只有ad_name,怎么写啊,万分感谢。最好还写个在PL/SQL中执行这个过程的语句,你一定要帮我啊
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://docs.oracle.com/cd/B13789_01/appdev.101/b10807/13_elems034.htm