我得到一個錯誤PL/SQL:ORA-00913:太多的值。 我想在這裏做什麼,我的更新語句影響多個行。 我想捕獲並保存記錄受影響的行另一個表。 請幫忙。 用於波紋管代碼。我想捕獲並保持記錄那些受影響的行另一個表
DECLARE
TYPE cusRec IS TABLE OF customer%ROWTYPE INDEX BY PLS_INTEGER;
v_cusRec cusRec;
BEGIN
UPDATE customer
SET l_optionalmail = 1
WHERE c_customer_id IN ( SELECT c_customer_id
FROM customer cus,
agent age
WHERE cus.c_customer_id = age.c_customer_id
AND cus.l_optionalmail = 0
GROUP BY age.c_customer_id
HAVING MIN (age.d_movein) >=SYSDATE-1)
RETURNING cus.c_customer_id,cus.c_lastname,l_optionalmail
BULK COLLECT INTO v_bif001Rec;
DBMS_OUTPUT.PUT_LINE('Updated l_optionalmail column ' || SQL%ROWCOUNT || ' Rows.');
FOR i IN v_bif001Rec.FIRST..v_bif001Rec.LAST LOOP
INSERT INTO l_optionalmail_wrk(c_customer_id,c_lastname,l_optionalmail,d_created)
VALUES (v_bif001Rec(i).c_customer_id,v_bif001Rec(i).c_lastname,v_bif001Rec(i).l_optionalmail,SYSDATE);
END LOOP;
END;
對我來說,它看起來像問題與v_bif001Rec。你能提供錯誤日誌嗎? – Rakesh