我是 Oracle Form 和 pl/sql 的新手。这是我的问题 在我的表单中,我得到了 3 个数据块,这些数据块显示了我从名为 BOS_M_HOLIDAY 的表中检索到的记录。但不知何故,循环后每个数据块中只显示最后一条记录。我检索记录的方式是使用 PRE-FORM 触发器和 WHEN-TIME-EXPIRED 触发器。这是我在 PRE-FORM 触发器中的代码:
DECLARE
CURSOR a_aa is SELECT HOL_DATE FROM BOS_M_HOLIDAY WHERE REGEXP_LIKE(HOL_DATE, '.......12') ORDER BY HOL_DATE;
CURSOR a_bb is SELECT HOL_DATE FROM BOS_M_HOLIDAY WHERE REGEXP_LIKE(HOL_DATE, '.......13') ORDER BY HOL_DATE ;
CURSOR a_cc is SELECT distinct DESCR FROM BOS_M_HOLIDAY WHERE REGEXP_LIKE(HOL_DATE, '.......13')ORDER BY 1;
Timer_ID TIMER;
BEGIN
OPEN a_aa;
LOOP
FETCH a_aa INTO :holiday_2012.HOL_DATE;
EXIT WHEN a_aa%notfound;
Timer_ID := FIND_TIMER('CALL_NEXT_RECORD');
IF NOT Id_Null(Timer_ID) THEN
Delete_Timer(Timer_ID);
END IF;
Timer_ID := Create_Timer('CALL_NEXT_RECORD',1,NO_REPEAT);
END LOOP;
CLOSE a_aa;
OPEN a_bb;
LOOP
FETCH a_bb INTO :holiday_2013.HOL_DATE;
EXIT WHEN a_bb%notfound;
Timer_ID := FIND_TIMER('CALL_NEXT_RECORD');
IF NOT Id_Null(Timer_ID) THEN
Delete_Timer(Timer_ID);
END IF;
Timer_ID := Create_Timer('CALL_NEXT_RECORD',1,NO_REPEAT);
END LOOP;
CLOSE a_bb;
OPEN a_cc;
LOOP
FETCH a_cc INTO :description.DESCR;
EXIT WHEN a_cc%notfound;
Timer_ID := FIND_TIMER('CALL_NEXT_RECORD');
IF NOT Id_Null(Timer_ID) THEN
Delete_Timer(Timer_ID);
END IF;
Timer_ID := Create_Timer('CALL_NEXT_RECORD',1,NO_REPEAT);
END LOOP;
CLOSE a_cc;
END;
这是我在 WHEN-TIME-EXPIRED 触发器中的代码:
DECLARE
v_Timer VARCHAR2(30) := Get_Application_Property(TIMER_NAME);
BEGIN
IF (v_Timer = 'CALL_NEXT_RECORD') THEN
NEXT_RECORD;
END IF;
END;
当我使用没有 TIMER 部分的 WHEN-BUTTON-PRESSED 触发器时,此代码有效。裸露我的英语,如果您不明白任何部分,请随时问我。谢谢!