0
我想寫一個簡單的光標並打開,獲取值並關閉。以下是我的光標代碼。錯誤,而在plsql中運行簡單的光標
DECLARE
id cur.sid%TYPE;
s_num cur.serial#%TYPE;
CURSOR cur IS
SELECT sid, serial#
FROM v$session WHERE username = 'ABC';
BEGIN
OPEN cur;
LOOP
FETCH c cur INTO id, s_num;
dbms_output.put_line(id || ' ' || s_num);
END LOOP;
CLOSE cur;
END;
/
當運行此我看到以下錯誤消息:
FETCH c cur INTO id, s_num;
*
ERROR at line 9:
ORA-06550: line 9, column 9:
PLS-00103: Encountered the symbol "CUR" when expecting one of the following:
. into bulk
The symbol "." was substituted for "CUR" to continue.
任何種類的方向來解決這個之一被理解。謝謝。
抓取只需要鼠標的名字 - 「C」 是沒有必要的。嘗試FETCH cur INTO id,scum; – racraman