我是匿名阻止,应删除@在电子邮件列中的所有内容。
DECLARE
v_id NUMBER(10);
v_email VARCHAR2(30);
i NUMBER(1) := 0;
CURSOR cursor_name IS
SELECT Id, (substr (email, instr (email,'@',1) + 1 )) AS Domain
FROM invoices
WHERE id=31232681;
BEGIN
OPEN cursor_name;
LOOP
v_email := '@' || v_email;
FETCH cursor_name INTO v_id, v_email;
UPDATE invoices
SET email = v_email
WHERE Id = v_id;
EXIT WHEN cursor_name%NOTFOUND
END LOOP;
CLOSE cursor_name;
END;
但是得到了PLS-00103错误:
PLS-00103: Encountered the symbol "(" when expecting one of the following:
:= . ) , @ % default character
The symbol ":=" was substituted for "(" to continue
可以帮我理解是什么问题吗?
解决方案 半结肠遗失在:
退出时为cursor_name%NOTFOUND;
答案 0 :(得分:0)
你能试试吗?
DECLARE
v_id NUMBER(10);
v_email VARCHAR2(30);
i NUMBER(1) := 0;
CURSOR cursor_name IS
SELECT Id, (substr (email, instr (email,'@',1) + 1 )) AS Domain
FROM invoices
WHERE id=31232681;
BEGIN
OPEN cursor_name;
LOOP
v_email := '@' || v_email;
FETCH cursor_name INTO v_id, v_email;
UPDATE invoices
SET email = v_email
WHERE Id = v_id;
EXIT WHEN cursor_name%NOTFOUND;
END LOOP;
CLOSE cursor_name;
END;
我现在已经看到了你的解决方案,抱歉:)