SQLPLUS 执行 forloop 插入表

BEGIN
    FOR v_LoopCounter IN 1..1000000 LOOP
        INSERT INTO LOOPTBL (id,first_name,last_name,current_date) VALUES (v_LoopCounter,'this_first_name','this_last_name',CURRENT_TIMESTAMP);
END LOOP;
END;

我在 sqlplus 中执行了上面的语句,但似乎没有执行。

让我们看看下面的画面

SQLPLUS 执行 forloop 插入表

shenlong1943 回答:SQLPLUS 执行 forloop 插入表

您需要一个斜杠 / 来终止匿名 PL/SQL 块:

BEGIN
  FOR v_LoopCounter IN 1..1000000 LOOP
    INSERT INTO LOOPTBL (id,first_name,last_name,current_date) 
      VALUES 
    (v_LoopCounter,'this_first_name','this_last_name',CURRENT_TIMESTAMP);
  END LOOP;
END;
/              --> this
本文链接:https://www.f2er.com/76686.html

大家都在问