1

我正在尝试在 APEX 中运行以下 PLSQL 脚本:

DECLARE
    total NUMBER;
BEGIN
    SELECT COUNT(*) 
    INTO total
    FROM one_table;

    FOR i IN 0:100 --This is line 8
    LOOP
        INSERT INTO other_table(id, column_a) SELECT id + i * total, column_a FROM one_table;
    END LOOP;
    COMMIT;
END;

我得到这个错误:

ORA-06550: line 8, column 15: PLS-00103: Encountered the symbol "" when expecting one of the following: * & - + / at mod remainder rem .. <an exponent (**)> || multiset The symbol ".." was substituted for "" to continue.'
4

1 回答 1

5

我不认为这是合法的语法:

FOR i IN 0:100

我想你的意思是:

FOR i IN 0..100
于 2012-05-21T23:36:18.947 回答