Here is my PL/SQL code to fetch checked checkbox value in a button's dynamic action.
(这是我的PL / SQL代码,用于在按钮的动态操作中获取选中的复选框值。)
DECLARE
IHC_ID_Y VARCHAR2(9);
IHC_ID_N VARCHAR2(9);
CURSOR Y IS
SELECT regexp_substr(:INFANT_HEALTH_CONDITIONS, '[^:]+', 1, level)
FROM DUAL
CONNECT BY regexp_substr(:INFANT_HEALTH_CONDITIONS, '[^:]+', 1, level) IS NOT NULL;
CURSOR N IS
SELECT regexp_substr(:INFANT_HEALTH_CONDITIONS, '[^:]+', 1, level)
FROM DUAL
CONNECT BY regexp_substr(:INFANT_HEALTH_CONDITIONS, '[^:]+', 1, level) IS NULL;
BEGIN
OPEN Y;
OPEN N;
LOOP
FETCH Y INTO IHC_ID_Y;
EXIT WHEN Y%NOTFOUND;
INSERT INTO INFANT_RESPONSE (INF_ID, IHC_ID, IR_DESCRIPTION) VALUES (:INF_ID, IHC_ID_Y, 'Y');
END LOOP;
CLOSE Y;
LOOP
FETCH N INTO IHC_ID_N;
EXIT WHEN N%NOTFOUND;
INSERT INTO INFANT_RESPONSE (INF_ID, IHC_ID, IR_DESCRIPTION) VALUES (:INF_ID, IHC_ID_N, 'N');
END LOOP;
CLOSE N;
END;
However, I met a problem in this part,
(但是,我在这部分遇到了一个问题,)
CURSOR N IS
SELECT regexp_substr(:INFANT_HEALTH_CONDITIONS, '[^:]+', 1, level)
FROM DUAL
CONNECT BY regexp_substr(:INFANT_HEALTH_CONDITIONS, '[^:]+', 1, level) IS NULL;
LOOP
FETCH N INTO IHC_ID_N;
EXIT WHEN N%NOTFOUND;
INSERT INTO INFANT_RESPONSE (INF_ID, IHC_ID, IR_DESCRIPTION) VALUES (:INF_ID, IHC_ID_N, 'N')
As you can see, when I change the condition from IS NOT NULL
to IS NULL
, the values being fetched will all be nulls and hence cannot be inserted into the table rows.
(如您所见,当我将条件从IS NOT NULL
更改为IS NULL
,要获取的值将全部为null,因此无法将其插入表行中。)
Is there any way to fetch the unchecked checkbox values? (有什么方法可以获取未选中的复选框值?)
ask by Holmes Queen translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…