- 最后登录
- 2015-4-22
- 在线时间
- 122 小时
- 威望
- 133
- 金钱
- 1304
- 注册时间
- 2012-2-22
- 阅读权限
- 50
- 帖子
- 144
- 精华
- 1
- 积分
- 133
- UID
- 254
|
2#
发表于 2012-12-6 16:25:54
本帖最后由 saup007 于 2012-12-6 16:29 编辑
我猜是不是这种可能?
SYS.PRVT_ADVISOR.SET_TASK_PARAMETER- PROCEDURE SET_TASK_PARAMETER(TASK_NAME IN VARCHAR2,
- PARAMETER IN VARCHAR2,
- DATA IN VARCHAR2,
- PROP IN BINARY_INTEGER := 0 ,
- SCOPE IN BINARY_INTEGER := FUTURE_EXECUTIONS,
- TASK_OWNER_ID IN BINARY_INTEGER := -1 ) IS
- TASK_ID_NUM BINARY_INTEGER := 0 ;
- TP SYS.WRI$_ADV_ABSTRACT_T;
- L_DATA VARCHAR2( 32767) := DATA;
- L_NAME VARCHAR2( 32767) := PARAMETER;
- ADV_PROP BINARY_INTEGER;
- TASK_PROP BINARY_INTEGER;
- L_NEW_FLAGS BINARY_INTEGER := 0 ;
- TASK_STATUS BINARY_INTEGER;
- TASK_STORED_PROP NUMBER;
- L_DEFAULTED BOOLEAN := FALSE;
- ENAME VARCHAR2( 30);
- BEGIN
- IF PROP IS NULL OR PROP = 0 THEN
- TASK_PROP := TASK_PROP_TASK;
- ELSE
- TASK_PROP := PROP;
- END IF;
- TASK_ID_NUM := VALIDATE_TASK(TASK_NAME, TASK_PROP, TASK_OWNER_ID);
- HANDLE_LOCK(TASK_ID_NUM, TASK_LOCK_X);
- CHECK_MODIFY(TASK_NAME, TASK_ID_NUM);
- TP := FETCH_ADVISOR(TASK_ID_NUM);
- SELECT PROPERTY
- INTO ADV_PROP
- FROM SYS.WRI$_ADV_DEFINITIONS
- WHERE ID = TP.ADVISOR_ID;
- SELECT NVL(E.STATUS, A.STATUS) STATUS#, A.PROPERTY
- INTO TASK_STATUS, TASK_STORED_PROP
- FROM WRI$_ADV_TASKS A, WRI$_ADV_EXECUTIONS E
- WHERE A.ID = E.TASK_ID(+)
- AND A.ADVISOR_ID = E.ADVISOR_ID(+)
- AND A.LAST_EXEC_NAME = E.NAME(+)
- AND A.ID = TASK_ID_NUM;
- VALIDATE_TASK_PARAMETER(TP,
- ADV_PROP,
- TASK_NAME,
- TASK_ID_NUM,
- TASK_STATUS,
- TASK_STORED_PROP,
- SCOPE,
- L_NAME,
- L_DATA,
- L_NEW_FLAGS);
- IF (SCOPE = FUTURE_EXECUTIONS) THEN
- IF (BITAND(ADV_PROP, ADV_PROP_MULTI_EXEC) <> 0) THEN
- PROPAGATE_TASK_PARAMETER(TASK_ID_NUM, L_NAME);
- END IF;
- UPDATE SYS.WRI$_ADV_PARAMETERS A
- SET A.VALUE = L_DATA, A.FLAGS = L_NEW_FLAGS
- WHERE A.TASK_ID = TASK_ID_NUM
- AND A.NAME = L_NAME
- AND A.VALUE <> L_DATA;
- ELSE
- ENAME := GET_LAST_EXECUTION(TASK_ID_NUM);
- MERGE INTO WRI$_ADV_EXEC_PARAMETERS P
- USING ( SELECT TASK_ID_NUM TASK_ID,
- ENAME EXEC_NAME,
- L_NAME NAME,
- L_DATA VALUE
- FROM DUAL) I
- ON (P.TASK_ID = I.TASK_ID AND P.EXEC_NAME = I.EXEC_NAME AND P.NAME = I.NAME)
- WHEN MATCHED THEN
- UPDATE SET P.VALUE = I.VALUE
- WHEN NOT MATCHED THEN
- INSERT
- (TASK_ID, EXEC_NAME, NAME, VALUE)
- VALUES -----2735行
- (I.TASK_ID, I.EXEC_NAME, I.NAME, I.VALUE);
- END IF;
- UPDATE_TASK(TASK_ID_NUM);
- COMMIT;
- HANDLE_LOCK(TASK_ID_NUM, TASK_LOCK_R);
- RETURN;
- EXCEPTION
- WHEN OTHERS THEN
- ROLLBACK;
- HANDLE_LOCK(TASK_ID_NUM, TASK_LOCK_R);
- RAISE;
- END SET_TASK_PARAMETER;
复制代码 因为L_DATA VARCHAR2( 32767) := DATA; 当VARCHAR2超过4000,估计就被Oracle认为是LONG类型了,在merge时报错。
16:24:41 sys@PRI11G> desc WRI$_ADV_EXEC_PARAMETERS
Name Null? Type
------------------------------------------------ --------
TASK_ID NOT NULL NUMBER
EXEC_NAME NOT NULL VARCHAR2(30)
NAME NOT NULL VARCHAR2(30)
VALUE NOT NULL VARCHAR2(4000) |
|