我有一个循环和一个变量v_rownum
,我想为它设置值:
FOR donvi_rows IN v_donvi
LOOP
DECLARE
v_rownum number;
SELECT r
INTO v_rownum
FROM
(SELECT ROWNUM AS r, k.Id
FROM don_vi k
WHERE k.ParentId = 1 )
WHERE Id = donvi_rows.Id;
END LOOP;
但它抛出一个异常:
PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
begin function pragma procedure subtype type <an identifier>
<a double-quoted delimited-identifier> current cursor delete
exists prior
The symbol "begin" was substituted for "SELECT" to continue.
我目前正在学习甲骨文。我对此了解不多。请帮我解决我的问题。