Best way to do multi-row insert in Oracle?

前端 未结 9 1544
悲&欢浪女
悲&欢浪女 2020-11-22 02:52

I\'m looking for a good way to perform multi-row inserts into an Oracle 9 database. The following works in MySQL but doesn\'t seem to be supported in Oracle.



        
9条回答
  •  星月不相逢
    2020-11-22 03:46

    you can insert using loop if you want to insert some random values.

    BEGIN 
        FOR x IN 1 .. 1000 LOOP
             INSERT INTO MULTI_INSERT_DEMO (ID, NAME)
             SELECT x, 'anyName' FROM dual;
        END LOOP;
    END;
    

提交回复
热议问题