close

先建立table

SQL> CREATE TABLE books (C_Id INT, Name varchar(50));

SQL> select * from books;

image

使用程式自動建立數據

插入數據,50次,使用循環語句

declare

  i number := 1;

begin

  for i in 1..50 loop

    INSERT INTO BOOKS

           ("C_ID", "NAME")

    VALUES

           (i, 'test');

  end loop;

end;

image

確認

SQL> select * from books;

image

創作者介紹
創作者 awdmo玩樂生活 的頭像
awdmo玩樂生活

玩樂生活部落格

awdmo玩樂生活 發表在 痞客邦 留言(0) 人氣()