LoginSignup
0
0

More than 1 year has passed since last update.

ただただ簡単なloop文

Posted at

今回はただただ簡単でシンプルなテストデータ作成を行います。
環境は Oracle Database 19c です。

SQL> create table test(C1 number(36),C2 varchar2(36));

Table created.

SQL> BEGIN
  2   FOR i IN 1..10 LOOP
  3    insert into test(C1,C2)values(i,'aaa');
  4   END LOOP;
  5  END;
  6  /

PL/SQL procedure successfully completed.

SQL> select * from test;

        C1 C2
---------- ------------------------------------
         1 aaa
         2 aaa
         3 aaa
         4 aaa
         5 aaa
         6 aaa
         7 aaa
         8 aaa
         9 aaa
        10 aaa

10 rows selected.

SQL 部分(insert ~)を LOOP させたい SQL に変更してください。

以上です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0