oracle存储过程1

来源:网络 责任编辑:栏目编辑 发表时间:2013-07-01 04:49 点击:

基本结构
CREATE OR REPLACEPROCEDURE 存储过程名字
(
    参数1 IN NUMBER,
    参数2 IN NUMBER
) IS
变量1 INTEGER :=0;
变量2 DATE;
BEGIN
END 存储过程名字
 
---查询数据 并返回一个列表
DROP PROCEDURE MRR.get_risk_assessment_by_status;
CREATE OR REPLACE PROCEDURE MRR.get_risk_assessment_by_status (
    out_ref_cursor OUT SYS_REFCURSOR,
    stas IN VARCHAR2
) IS
BEGIN
    OPEN out_ref_cursor FOR
         SELECT RA.riskassessment_id as RA_RISKASSESSMENT_ID, RA.riskconfig_id as RA_RISKCONFIG_ID, RA.assessment_status as RA_ASSESSMENT_STATUS, RA.changed_numeric_rating_id as RA_CHANGED_NUMERIC_RATING_ID, RA.changed_alpha_rating_id as RA_CHANGED_ALPHA_RATING_ID, RA.due_date as RA_DUE_DATE, RA.initial_assessment_complete as RA_INITIAL_ASSESSMENT_COMPLETE, RA.initial_numeric_rating_id as RA_INITIAL_NUMERIC_RATING_ID, RA.initial_alpha_rating_id as RA_INITIAL_ALPHA_RATING_ID, RA.notes as RA_NOTES, RA.prior_riskassessment_id as RA_PRIOR_RISKASSESSMENT_ID, RA.risk_mgmt_approval_date as RA_RISK_MGMT_APPROVAL_DATE, RA.risk_mgmt_approval_emp_id as RA_RISK_MGMT_APPROVAL_EMP_ID, RA.last_updated_by as RA_LAST_UPDATED_BY, RA.last_updated as RA_LAST_UPDATED,
                RC.riskconfig_id as RC_RISKCONFIG_ID, RC.riskcategorygroup_id as RC_RISKCATEGORYGROUP_ID, RC.contractentity_id as RC_CONTRACTENTITY_ID, RC.accountgroup_id as RC_ACCOUNTGROUP_ID, RC.account_id as RC_ACCOUNT_ID, RC.contract_id as RC_CONTRACT_ID, RC.next_assessment_due_date as RC_NEXT_ASSESSMENT_DUE_DATE, RC.ninety_day_assessment_complete as RC_NINETY_DAY_ASSESS_COMPLE, RC.inactive_date as RC_INACTIVE_DATE, RC.last_updated_by as RC_LAST_UPDATED_BY, RC.last_updated as RC_LAST_UPDATED
          FROM MRR.riskassessment RA, MRR.riskconfig RC
          WHERE RA.riskconfig_id = RC.riskconfig_id
          AND RA.assessment_status = stas;
END;
/
GRANT EXECUTE ON MRR.get_risk_assessment_by_status TO DMM_KCMRLRSK_ROLE;
/
 

本文出自 “坠落凡间的天使” 博客

    发表评论
    请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
    用户名: 验证码:点击我更换图片
    最新评论 更多>>

    推荐热点

    • Table函数使用简介
    • Oracle数据库Constraint约束的常用操作及异常处理
    • Bulk Collect性能分析(zz)
    • export/import的使用
    • OCP043第十五讲 Database Security
    • ORACLE10gr2数据导入MySQL方案
    • oracle 让sys用户可以使用isqlplus
    • 在oracle数据库下使用iSQL*Plus DBA访问数据库
    • Oracle行列转换小结
    网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
    Copyright © 2008-2015 计算机技术学习交流网. 版权所有

    豫ICP备11007008号-1