- 浏览: 194420 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
小灯笼:
分布式消息队列高效部署及插件集群开发信息数据监控、分析实战(R ...
RabbitMQ入门学习——Work queues 工作队列 -
快乐的小六:
分布式消息队列高效部署及插件集群开发信息数据监控、分析实战(R ...
RabbitMQ入门学习——Work queues 工作队列 -
wyzxzws:
写得够详细~!
linux下java开发环境搭建 -
easy_jing01:
帮了我一个大忙,谢谢啦
jquery---------ajax+validate表单异步提交验证
CREATE OR REPLACE PROCEDURE PRC_STATISTICS_RTX( --参数IN表示输入参数,OUT表示输出参数,类型可以使用任意Oracle中的合法类型。 CHECKYEAR IN VARCHAR2, CHECKQUARTER IN VARCHAR2) AS -----------------定义变量------------------------- KPI_USER_ID NUMBER(11); --当前遍历的员工(被评价人) KPI_PRAISE_ID NUMBER(11); --评价人 KPI_CONTACT_TIME NUMBER(11); --联系次数 KPI_DIRECTOR VARCHAR2(50); --直接主管,组织结构多负责人,所以可能有多个直接主管 KPI_DEPT_MANAGER VARCHAR2(50); --部门主管,组织结构多负责人,所以可能有多个部门主管 KPI_SUBORDINATE VARCHAR2(1000); --直接下属员工 (组长查询自己的组员,经理及总监查询小组负责人) KPI_VARIABLE VARCHAR2(20); --每次遍历游标时,临时存放数据 D_QUESTION NUMBER(11); --主管的问卷ID E_QUESTION NUMBER(11); --普通员工的问卷ID --主管考核维度 直接定义,免去每次for循环来遍历 D_CHECK_LEVEL1 NUMBER(11); --直接主管 D_CHECK_LEVEL2 NUMBER(11); --直接下属 D_CHECK_LEVEL3 NUMBER(11); --同部门 D_CHECK_LEVEL4 NUMBER(11); --合作部门 --主管考核维度对应的上限人数 D_CHECK_NUM1 NUMBER(11); --直接主管 D_CHECK_NUM2 NUMBER(11); --直接下属 D_CHECK_NUM3 NUMBER(11); --同部门 D_CHECK_NUM4 NUMBER(11); --合作部门 --普通员工考核维度 E_CHECK_LEVEL1 NUMBER(11); --直接主管 E_CHECK_LEVEL2 NUMBER(11); --部门主管 E_CHECK_LEVEL3 NUMBER(11); --同部门 E_CHECK_LEVEL4 NUMBER(11); --合作部门 --普通员工考核维度对应的上限人数 E_CHECK_NUM1 NUMBER(11); --直接主管 E_CHECK_NUM2 NUMBER(11); --部门主管 E_CHECK_NUM3 NUMBER(11); --同部门 E_CHECK_NUM4 NUMBER(11); --合作部门 -----------------------定义数组--------------------- --考核维度表 -- checklevel m_kpi_360check_level%rowtype; --定义一个变量(每一行的数据) TYPE CHECKLEVELTBL IS TABLE OF M_KPI_360CHECK_LEVEL%ROWTYPE INDEX BY BINARY_INTEGER; --用变量定义一个表结构 V_CHECKLEVEL CHECKLEVELTBL; --用新的表结构定义一个变量(当做数组使用) --问卷 -- question t_360check_questions%rowtype; TYPE QUESTIONTBL IS TABLE OF T_360CHECK_QUESTIONS%ROWTYPE INDEX BY BINARY_INTEGER; V_QUESTION QUESTIONTBL; --需要考核的员工 -- userextend t_usr_extend%rowtype; TYPE USEREXTENDTBL IS TABLE OF T_USR_EXTEND%ROWTYPE INDEX BY BINARY_INTEGER; V_EXTEND USEREXTENDTBL; --员工的直接主管 TYPE DIRECTORTBL IS TABLE OF VARCHAR2(50) INDEX BY BINARY_INTEGER; --用变量定义一个表结构 V_DIRECTOR DIRECTORTBL; --RTX及邮件统计的发送人,接收人和联系次数 TYPE RTXCONTACT IS TABLE OF W_ECM_IM_LOG%ROWTYPE INDEX BY BINARY_INTEGER; --用变量定义一个表结构 V_RTXCONTACT RTXCONTACT; ---------------定义游标-------------------------- CURSOR CURSOR_1(NO NUMBER) IS SELECT O.MANAGER_IDS FROM M_ORGANIZATION O WHERE O.PARENT_ID IN (SELECT ORG_ID FROM M_EMPLOYEE E WHERE E.USER_ID = NO); BEGIN ------------存储过程开始执行,记录日志-------------- WRITE_LOG('PROCEDURE:TEST3', 'START', '存储过程TEST3开始执行:统计员工RTX及邮件联系人,生成绩效考核答卷表---------开始执行'); COMMIT; SELECT * BULK COLLECT INTO V_CHECKLEVEL FROM M_KPI_360CHECK_LEVEL T; --考核维度 SELECT * BULK COLLECT INTO V_QUESTION FROM T_360CHECK_QUESTIONS WHERE CHECK_YEAR = CHECKYEAR AND CHECK_QUARTER = CHECKQUARTER; -- 问卷 SELECT T.* BULK COLLECT INTO V_EXTEND FROM T_USR_EXTEND T JOIN M_EMPLOYEE E ON T.USER_ID = E.USER_ID WHERE T.IS_CHECK = '1' AND E.STATUS = '1'; --参与考核员工 -----遍历考核维度,依次获得不同员工级别不同考核维度对应的维度ID----- FOR I IN 1 .. V_CHECKLEVEL.COUNT LOOP --主管 IF V_CHECKLEVEL(I).EMP_LEVEL = 0 THEN CASE WHEN V_CHECKLEVEL(I).APPRAISE_LEVEL = 1 THEN --直接主管 D_CHECK_LEVEL1 := V_CHECKLEVEL(I).CHECK_LEVEL_ID; D_CHECK_NUM1 := V_CHECKLEVEL(I).UPPER_LIMIT_NUM; WHEN V_CHECKLEVEL(I).APPRAISE_LEVEL = 2 THEN --直接下属 D_CHECK_LEVEL2 := V_CHECKLEVEL(I).CHECK_LEVEL_ID; D_CHECK_NUM2 := V_CHECKLEVEL(I).UPPER_LIMIT_NUM; WHEN V_CHECKLEVEL(I).APPRAISE_LEVEL = 3 THEN --同部门员工 D_CHECK_LEVEL3 := V_CHECKLEVEL(I).CHECK_LEVEL_ID; D_CHECK_NUM3 := V_CHECKLEVEL(I).UPPER_LIMIT_NUM; WHEN V_CHECKLEVEL(I).APPRAISE_LEVEL = 4 THEN --合作部门员工 D_CHECK_LEVEL4 := V_CHECKLEVEL(I).CHECK_LEVEL_ID; D_CHECK_NUM4 := V_CHECKLEVEL(I).UPPER_LIMIT_NUM; END CASE; END IF; --普通员工 IF V_CHECKLEVEL(I).EMP_LEVEL = 1 THEN CASE WHEN V_CHECKLEVEL(I).APPRAISE_LEVEL = 1 THEN --直接主管 E_CHECK_LEVEL1 := V_CHECKLEVEL(I).CHECK_LEVEL_ID; E_CHECK_NUM1 := V_CHECKLEVEL(I).UPPER_LIMIT_NUM; WHEN V_CHECKLEVEL(I).APPRAISE_LEVEL = 5 THEN --部门主管(二级主管) E_CHECK_LEVEL2 := V_CHECKLEVEL(I).CHECK_LEVEL_ID; E_CHECK_NUM2 := V_CHECKLEVEL(I).UPPER_LIMIT_NUM; WHEN V_CHECKLEVEL(I).APPRAISE_LEVEL = 3 THEN --同部门员工 E_CHECK_LEVEL3 := V_CHECKLEVEL(I).CHECK_LEVEL_ID; E_CHECK_NUM3 := V_CHECKLEVEL(I).UPPER_LIMIT_NUM; WHEN V_CHECKLEVEL(I).APPRAISE_LEVEL = 4 THEN --合作部门员工 E_CHECK_LEVEL4 := V_CHECKLEVEL(I).CHECK_LEVEL_ID; E_CHECK_NUM4 := V_CHECKLEVEL(I).UPPER_LIMIT_NUM; END CASE; END IF; END LOOP; --遍历问卷表,获得不同级别员工对应的问卷ID FOR I IN 1 .. V_QUESTION.COUNT LOOP --主管 IF V_QUESTION(I).EMP_LEVEL = 0 THEN D_QUESTION := V_QUESTION(I).QID; END IF; --普通员工 IF V_QUESTION(I).EMP_LEVEL = 1 THEN E_QUESTION := V_QUESTION(I).QID; END IF; END LOOP; --把数据插入临时表中 ------RTX和邮件的联系次数之和,插入临时表----------- INSERT INTO W_ECM_IM_LOG SELECT A.IM_FROM_SENDER, A.PRAISE, SUM(NUM) AS NUM FROM (SELECT T.IM_FROM_SENDER, REGEXP_SUBSTR(IM_TO_RECEIVERS, '[^,]+', 1, L) AS PRAISE, SUM(NUM) AS NUM FROM (SELECT T.IM_FROM_SENDER, T.IM_TO_RECEIVERS, COUNT(*) AS NUM FROM T_ECM_IM_LOG T GROUP BY T.IM_FROM_SENDER, T.IM_TO_RECEIVERS) T, (SELECT LEVEL L FROM DUAL CONNECT BY LEVEL <= 100) WHERE L <= LENGTH(IM_TO_RECEIVERS) - LENGTH(REPLACE(IM_TO_RECEIVERS, ',')) + 1 GROUP BY IM_FROM_SENDER, REGEXP_SUBSTR(IM_TO_RECEIVERS, '[^,]+', 1, L) UNION ALL SELECT U1.DOMAIN_USER AS IM_FROM_SENDER, U2.DOMAIN_USER AS PRAISE, A.NUM FROM (SELECT T.MAIL_FROM_SENDERS, T.MAIL_TO_RECEIVERS, COUNT(*) AS NUM FROM T_ECM_MAIL_LOG T GROUP BY T.MAIL_FROM_SENDERS, T.MAIL_TO_RECEIVERS) A, M_USERS U1, M_USERS U2 WHERE A.MAIL_FROM_SENDERS = U1.REG_IP AND A.MAIL_TO_RECEIVERS = U2.REG_IP AND U1.DOMAIN_USER IS NOT NULL AND U2.DOMAIN_USER IS NOT NULL) A GROUP BY IM_FROM_SENDER, PRAISE; --------------------------------开始遍历员工----------------------------------------------- --遍历所有参与考核的员工 FOR I IN 1 .. V_EXTEND.COUNT LOOP KPI_USER_ID := V_EXTEND(I).USER_ID; --当前遍历的员工 ------主管-------------------- IF V_EXTEND(I).EMP_LEVEL = 0 THEN --查找直接主管 SELECT O.MANAGER_IDS BULK COLLECT INTO V_DIRECTOR FROM M_ORGANIZATION O WHERE O.MANAGER_IDS IS NOT NULL START WITH O.ORG_ID IN (SELECT ORG_ID FROM M_EMPLOYEE E WHERE E.USER_ID = KPI_USER_ID) CONNECT BY ORG_ID = PRIOR PARENT_ID ORDER BY O.TYPE DESC; IF V_DIRECTOR.COUNT >= 2 THEN KPI_DIRECTOR := V_DIRECTOR(2); SELECT A.* BULK COLLECT INTO V_RTXCONTACT FROM (SELECT U1.USER_ID AS ACCEPT, U2.USER_ID AS PRAISE, T.NUM FROM W_ECM_IM_LOG T, M_USERS U1, M_USERS U2 WHERE T.ACCEPT = U1.DOMAIN_USER AND T.PRAISE = U2.DOMAIN_USER AND U1.USER_ID = KPI_USER_ID AND ',' || KPI_DIRECTOR || ',' LIKE '%,' || U2.USER_ID || ',%' ORDER BY NUM DESC) A WHERE ROWNUM <= D_CHECK_NUM1; --组织结构多负责人 FOR J IN 1 .. V_RTXCONTACT.COUNT LOOP INSERT INTO T_360CHECK_ANSWER_TMP (CA_ID, ACCEPT_APPRAISE_USER, APPRAISE_USER, CHECK_LEVEL_ID, QID, STATUS, CONTACT_TIMES) VALUES (OA_SEQ_BASE.NEXTVAL, KPI_USER_ID, V_RTXCONTACT(J).PRAISE, D_CHECK_LEVEL1, D_QUESTION, 0, V_RTXCONTACT(J).NUM); END LOOP; END IF; ----------查找直接下属------------- KPI_SUBORDINATE := ''; --该游标查询自己下级小组负责人,所以查询组长的直接下属时为空 OPEN CURSOR_1(KPI_USER_ID); FETCH CURSOR_1 INTO KPI_SUBORDINATE; --如果游标返回结果为空,则当前遍历员工是组长,查询自己相同小组下的员工作为自己的直接下属 IF CURSOR_1%NOTFOUND THEN SELECT A.* BULK COLLECT INTO V_RTXCONTACT FROM (SELECT U1.USER_ID AS ACCEPT, U2.USER_ID AS PRAISE, T.NUM FROM W_ECM_IM_LOG T, M_USERS U1, M_USERS U2, M_EMPLOYEE E WHERE T.ACCEPT = U1.DOMAIN_USER AND T.PRAISE = U2.DOMAIN_USER AND E.ORG_ID IN (SELECT ORG_ID FROM M_EMPLOYEE WHERE USER_ID = KPI_USER_ID) AND U1.USER_ID = KPI_USER_ID AND E.USER_ID = U2.USER_ID ORDER BY T.NUM DESC) A WHERE ROWNUM <= D_CHECK_NUM2; FOR J IN 1 .. V_RTXCONTACT.COUNT LOOP --直接下属拼接成字符串,查询同部门员工时,这部分员工不包括在内 KPI_SUBORDINATE := KPI_SUBORDINATE || ',' || V_RTXCONTACT(J) .PRAISE; INSERT INTO T_360CHECK_ANSWER_TMP (CA_ID, ACCEPT_APPRAISE_USER, APPRAISE_USER, CHECK_LEVEL_ID, QID, STATUS, CONTACT_TIMES) VALUES (OA_SEQ_BASE.NEXTVAL, KPI_USER_ID, V_RTXCONTACT(J).PRAISE, D_CHECK_LEVEL2, D_QUESTION, 0, V_RTXCONTACT(J).NUM); END LOOP; ELSE LOOP FETCH CURSOR_1 INTO KPI_VARIABLE; KPI_SUBORDINATE := KPI_SUBORDINATE || ',' || KPI_VARIABLE; EXIT WHEN CURSOR_1%NOTFOUND; END LOOP; KPI_SUBORDINATE := KPI_SUBORDINATE || ','; SELECT A.* BULK COLLECT INTO V_RTXCONTACT FROM (SELECT U1.USER_ID AS ACCEPT, U2.USER_ID AS PRAISE, T.NUM FROM W_ECM_IM_LOG T, M_USERS U1, M_USERS U2 WHERE T.ACCEPT = U1.DOMAIN_USER AND T.PRAISE = U2.DOMAIN_USER AND U1.USER_ID = KPI_USER_ID AND ',' || KPI_SUBORDINATE || ',' LIKE '%,' || U2.USER_ID || ',%' ORDER BY T.NUM DESC) A WHERE ROWNUM <= D_CHECK_NUM2; FOR J IN 1 .. V_RTXCONTACT.COUNT LOOP INSERT INTO T_360CHECK_ANSWER_TMP (CA_ID, ACCEPT_APPRAISE_USER, APPRAISE_USER, CHECK_LEVEL_ID, QID, STATUS, CONTACT_TIMES) VALUES (OA_SEQ_BASE.NEXTVAL, KPI_USER_ID, V_RTXCONTACT(J).PRAISE, D_CHECK_LEVEL2, D_QUESTION, 0, V_RTXCONTACT(J).NUM); END LOOP; END IF; CLOSE CURSOR_1; ---------------------查找同部门同事-------------------- SELECT A.* BULK COLLECT INTO V_RTXCONTACT FROM ( SELECT U1.USER_ID AS ACCEPT, U2.USER_ID AS PRAISE, T.NUM FROM W_ECM_IM_LOG T, M_USERS U1, M_USERS U2, M_EMPLOYEE E1 WHERE T.ACCEPT = U1.DOMAIN_USER AND T.PRAISE = U2.DOMAIN_USER AND U2.USER_ID = E1.USER_ID AND U1.USER_ID = KPI_USER_ID AND E1.DEPT_ID IN (SELECT DEPT_ID FROM M_EMPLOYEE WHERE USER_ID = KPI_USER_ID) AND ',' || KPI_DIRECTOR || ',' NOT LIKE --除去直接主管 ',%' || E1.USER_ID || ',%' AND ',' || KPI_SUBORDINATE || ',' NOT LIKE --除去直接下属 ',%' || E1.USER_ID || ',%' ORDER BY T.NUM DESC) A WHERE ROWNUM <= D_CHECK_NUM3; IF V_DIRECTOR.COUNT >= 1 THEN FOR J IN 1 .. V_RTXCONTACT.COUNT LOOP INSERT INTO T_360CHECK_ANSWER_TMP (CA_ID, ACCEPT_APPRAISE_USER, APPRAISE_USER, CHECK_LEVEL_ID, QID, STATUS, CONTACT_TIMES) VALUES (OA_SEQ_BASE.NEXTVAL, KPI_USER_ID, V_RTXCONTACT(J).PRAISE, D_CHECK_LEVEL3, D_QUESTION, 0, V_RTXCONTACT(J).NUM); END LOOP; END IF; ----------------------查找不同部门同事------------------ SELECT A.* BULK COLLECT INTO V_RTXCONTACT FROM ( SELECT U1.USER_ID AS ACCEPT, U2.USER_ID AS PRAISE, T.NUM FROM W_ECM_IM_LOG T, M_USERS U1, M_USERS U2, M_EMPLOYEE E1 WHERE T.ACCEPT = U1.DOMAIN_USER AND T.PRAISE = U2.DOMAIN_USER AND U2.USER_ID = E1.USER_ID AND U1.USER_ID = KPI_USER_ID AND E1.DEPT_ID NOT IN (SELECT DEPT_ID FROM M_EMPLOYEE WHERE USER_ID = KPI_USER_ID) AND ',' || KPI_DIRECTOR || ',' NOT LIKE ',%' || E1.USER_ID || ',%' AND ',' || KPI_SUBORDINATE || ',' NOT LIKE ',%' || E1.USER_ID || ',%' ORDER BY T.NUM DESC) A WHERE ROWNUM <= D_CHECK_NUM4; IF V_DIRECTOR.COUNT >= 1 THEN FOR J IN 1 .. V_RTXCONTACT.COUNT LOOP INSERT INTO T_360CHECK_ANSWER_TMP (CA_ID, ACCEPT_APPRAISE_USER, APPRAISE_USER, CHECK_LEVEL_ID, QID, STATUS, CONTACT_TIMES) VALUES (OA_SEQ_BASE.NEXTVAL, KPI_USER_ID, V_RTXCONTACT(J).PRAISE, D_CHECK_LEVEL4, D_QUESTION, 0, V_RTXCONTACT(J).NUM); END LOOP; END IF; END IF; ----------------普通员工--------------- IF V_EXTEND(I).EMP_LEVEL = '1' THEN --递归查询,既包括直接主管,又包括部门主管 SELECT O.MANAGER_IDS BULK COLLECT INTO V_DIRECTOR FROM M_ORGANIZATION O WHERE O.MANAGER_IDS IS NOT NULL START WITH O.ORG_ID IN (SELECT ORG_ID FROM M_EMPLOYEE E WHERE E.USER_ID = KPI_USER_ID) CONNECT BY ORG_ID = PRIOR PARENT_ID ORDER BY O.TYPE DESC; ---------直接主管------- IF V_DIRECTOR.COUNT >= 1 THEN KPI_DIRECTOR := V_DIRECTOR(1); --和直接主管之间RTX联系次数 SELECT A.* BULK COLLECT INTO V_RTXCONTACT FROM (SELECT U1.USER_ID AS ACCEPT, U2.USER_ID AS PRAISE, T.NUM FROM W_ECM_IM_LOG T, M_USERS U1, M_USERS U2 WHERE T.ACCEPT = U1.DOMAIN_USER AND T.PRAISE = U2.DOMAIN_USER AND U1.USER_ID = KPI_USER_ID AND ',' || KPI_DIRECTOR || ',' LIKE '%,' || U2.USER_ID || ',%' ORDER BY NUM DESC) A WHERE ROWNUM <= E_CHECK_NUM1; --组织结构多负责人 FOR J IN 1 .. V_RTXCONTACT.COUNT LOOP INSERT INTO T_360CHECK_ANSWER_TMP (CA_ID, ACCEPT_APPRAISE_USER, APPRAISE_USER, CHECK_LEVEL_ID, QID, STATUS, CONTACT_TIMES) VALUES (OA_SEQ_BASE.NEXTVAL, KPI_USER_ID, V_RTXCONTACT(J).PRAISE, E_CHECK_LEVEL1, E_QUESTION, 0, V_RTXCONTACT(J).NUM); END LOOP; END IF; ------部门主管----- IF V_DIRECTOR.COUNT >= 2 THEN KPI_DEPT_MANAGER := V_DIRECTOR(2); --和部门主管之间RTX联系次数 SELECT A.* BULK COLLECT INTO V_RTXCONTACT FROM (SELECT U1.USER_ID AS ACCEPT, U2.USER_ID AS PRAISE, T.NUM FROM W_ECM_IM_LOG T, M_USERS U1, M_USERS U2 WHERE T.ACCEPT = U1.DOMAIN_USER AND T.PRAISE = U2.DOMAIN_USER AND U1.USER_ID = KPI_USER_ID AND ',' || KPI_DEPT_MANAGER || ',' LIKE '%,' || U2.USER_ID || ',%' ORDER BY NUM DESC) A WHERE ROWNUM <= E_CHECK_LEVEL2; --组织结构多负责人 FOR J IN 1 .. V_RTXCONTACT.COUNT LOOP INSERT INTO T_360CHECK_ANSWER_TMP (CA_ID, ACCEPT_APPRAISE_USER, APPRAISE_USER, CHECK_LEVEL_ID, QID, STATUS, CONTACT_TIMES) VALUES (OA_SEQ_BASE.NEXTVAL, KPI_USER_ID, V_RTXCONTACT(J).PRAISE, E_CHECK_LEVEL2, E_QUESTION, 0, V_RTXCONTACT(J).NUM); END LOOP; END IF; -------------部门内同事------- SELECT A.* BULK COLLECT INTO V_RTXCONTACT FROM ( SELECT U1.USER_ID AS ACCEPT, U2.USER_ID AS PRAISE, T.NUM FROM W_ECM_IM_LOG T, M_USERS U1, M_USERS U2, M_EMPLOYEE E1 WHERE T.ACCEPT = U1.DOMAIN_USER AND T.PRAISE = U2.DOMAIN_USER AND U2.USER_ID = E1.USER_ID AND U1.USER_ID = KPI_USER_ID AND E1.DEPT_ID IN (SELECT DEPT_ID FROM M_EMPLOYEE WHERE USER_ID = KPI_USER_ID) AND ',' || KPI_DIRECTOR || ',' NOT LIKE ',%' || E1.USER_ID || ',%' AND ',' || KPI_DEPT_MANAGER || ',' NOT LIKE ',%' || E1.USER_ID || ',%' ORDER BY T.NUM DESC) A WHERE ROWNUM <= E_CHECK_NUM3; IF V_DIRECTOR.COUNT >= 1 THEN FOR J IN 1 .. V_RTXCONTACT.COUNT LOOP INSERT INTO T_360CHECK_ANSWER_TMP (CA_ID, ACCEPT_APPRAISE_USER, APPRAISE_USER, CHECK_LEVEL_ID, QID, STATUS, CONTACT_TIMES) VALUES (OA_SEQ_BASE.NEXTVAL, KPI_USER_ID, V_RTXCONTACT(J).PRAISE, E_CHECK_LEVEL3, E_QUESTION, 0, V_RTXCONTACT(J).NUM); END LOOP; END IF; -------------部门间同事------- SELECT A.* BULK COLLECT INTO V_RTXCONTACT FROM ( SELECT U1.USER_ID AS ACCEPT, U2.USER_ID AS PRAISE, T.NUM FROM W_ECM_IM_LOG T, M_USERS U1, M_USERS U2, M_EMPLOYEE E1 WHERE T.ACCEPT = U1.DOMAIN_USER AND T.PRAISE = U2.DOMAIN_USER AND U2.USER_ID = E1.USER_ID AND U1.USER_ID = KPI_USER_ID AND E1.DEPT_ID NOT IN (SELECT DEPT_ID FROM M_EMPLOYEE WHERE USER_ID = KPI_USER_ID) AND ',' || KPI_DIRECTOR || ',' NOT LIKE ',%' || E1.USER_ID || ',%' AND ',' || KPI_DEPT_MANAGER || ',' NOT LIKE ',%' || E1.USER_ID || ',%' ORDER BY T.NUM DESC) A WHERE ROWNUM <= E_CHECK_NUM4; IF V_DIRECTOR.COUNT >= 1 THEN FOR J IN 1 .. V_RTXCONTACT.COUNT LOOP INSERT INTO T_360CHECK_ANSWER_TMP (CA_ID, ACCEPT_APPRAISE_USER, APPRAISE_USER, CHECK_LEVEL_ID, QID, STATUS, CONTACT_TIMES) VALUES (OA_SEQ_BASE.NEXTVAL, KPI_USER_ID, V_RTXCONTACT(J).PRAISE, E_CHECK_LEVEL4, E_QUESTION, 0, V_RTXCONTACT(J).NUM); END LOOP; END IF; END IF; END LOOP; --------------------RTX和邮件统计结束,记录日志---------------------------- WRITE_LOG('PROCEDURE:TEST3', 'END', '存储过程TEST3开始执行:统计员工RTX及邮件联系人,生成绩效考核答卷表------执行结束'); COMMIT; EXCEPTION --捕获所有的异常(类似JAVA中的Exception) WHEN OTHERS THEN ROLLBACK; --插入异常日志(方法必须有返回值,这里调用另一个存储过程,记录日志) WRITE_LOG('PROCEDURE:TEST3', 'ERROR', SUBSTR(SQLERRM, 0, 3000) || SUBSTR(DBMS_UTILITY.FORMAT_ERROR_BACKTRACE, 0, 1000)); END PRC_STATISTICS_RTX;
相关推荐
本文将从 Oracle 存储过程的基础知识开始,逐步深入到 Oracle 存储过程的高级应用,包括 Hibernate 调用 Oracle 存储过程和 Java 调用 Oracle 存储过程的方法。 Oracle 存储过程基础知识 Oracle 存储过程是 Oracle...
Oracle存储过程unwrap解密工具主要用于处理Oracle数据库中的加密存储过程。在Oracle数据库系统中,为了保护敏感代码或数据,开发人员有时会选择对存储过程进行加密。然而,当需要查看、调试或恢复这些加密的存储过程...
总结起来,"帆软报表Oracle存储过程解决storeParameter1参数试用插件"主要是针对在调用无参数Oracle存储过程时出现的异常问题提供的一种解决方案。通过安装并配置这个插件,用户可以顺利地在帆软报表中调用不包含...
以下是对“oracle存储过程解锁”这一主题的深入解析。 ### 标题:“oracle存储过程解锁” #### 解析: 在Oracle数据库中,存储过程是一种预先编译并存储在数据库中的SQL代码块,用于执行复杂的业务逻辑或数据处理...
本文实例讲述了Python使用cx_Oracle调用Oracle存储过程的方法。分享给大家供大家参考,具体如下: 这里主要测试在Python中通过cx_Oracle调用PL/SQL。 首先,在数据库端创建简单的存储过程。 create or replace ...
Oracle存储过程是数据库管理系统中的一种重要特性,它允许开发者编写一系列SQL语句和PL/SQL块,形成可重复使用的代码单元。这篇博客“oracle存储过程-帮助文档”可能提供了关于如何创建、调用和管理Oracle存储过程...
### Oracle存储过程、函数与DBLink详解 #### 一、Oracle存储过程简介 在Oracle数据库中,存储过程是一种预编译好的SQL代码集合,它可以接受输入参数、返回单个值或多个值,并能够执行复杂的数据库操作。存储过程...
本文将深入探讨如何在Spring Boot项目中整合MyBatis,实现调用Oracle存储过程并处理游标返回的数据。 首先,我们需要在Spring Boot项目中引入相关的依赖。在`pom.xml`文件中添加Oracle JDBC驱动(ojdbc66-oracle...
以下是一个简单的示例,展示了如何调用一个不带参数的Oracle存储过程: ```java Session session = sessionFactory.openSession(); Transaction transaction = session.beginTransaction(); session....
本篇文章将深入探讨如何在Oracle存储过程中使用临时表,包括会话级临时表和事务级临时表。 ### 会话级临时表 会话级临时表(Session-Level Temporary Tables)只在创建它的会话内可见,并且在会话结束时自动删除。...
Oracle存储过程是数据库管理系统Oracle中的一个关键特性,它允许开发者编写一组预编译的SQL和PL/SQL语句,以实现特定的业务逻辑或数据库操作。这篇教程将深入讲解Oracle存储过程的各个方面,帮助你从基础到高级全面...
本文将详细讲解如何在C#中使用自定义列表(List)作为参数调用Oracle存储过程,以及实现这一功能的关键技术和注意事项。 首先,我们需要了解Oracle数据库中的PL/SQL类型,例如VARCAR2、NUMBER等,它们对应于C#中的...
### Oracle存储过程批量提交知识点详解 在Oracle数据库中,存储过程是一种重要的数据库对象,它可以包含一系列SQL语句和控制流语句,用于实现复杂的业务逻辑处理。存储过程不仅可以提高应用程序性能,还可以确保...
标题中的“pb中执行oracle存储过程脚本”指的是在PowerBuilder(简称PB)环境中调用Oracle数据库的存储过程。PowerBuilder是一种可视化的开发工具,常用于构建数据驱动的应用程序。Oracle存储过程则是在Oracle数据库...
oracle 存储过程导出excel oracle 存储过程导出excel oracle 存储过程导出excel oracle 存储过程导出excel oracle 存储过程导出excel
Oracle 存储过程调用 CallabledStatement 实用例子(IN OUT 传游标) 一、Oracle 存储过程简介 Oracle 存储过程是一种可以在 Oracle 数据库中存储和执行的程序单元。存储过程可以由多种语言编写,例如 PL/SQL、...
本篇将深入探讨如何在Oracle存储过程中创建并返回一个结果集,并结合Java代码展示如何在应用程序中使用这个结果集。 首先,我们需要理解`OUT`参数的概念。在Oracle存储过程中,`IN`参数用于传递数据到过程,`OUT`...
可以将SQL Server存储过程转为oracle存储过程的工具
Oracle存储过程常用技巧 Oracle存储过程是一种强大的数据库对象,它可以帮助开发者简化复杂的业务逻辑,并提高数据库的安全性和性能。在 Oracle 中,存储过程是一种特殊的 PL/SQL 程序,它可以接受输入参数,执行...
本话题将详细探讨如何在Oracle存储过程中调用外部的批处理脚本,如Windows系统的BAT文件,以实现数据库操作与系统命令的集成。 首先,`Oracle存储过程`是一种预编译的SQL和PL/SQL代码集合,可以被多次调用以执行...