I am using oracle sql developer to insert rows in my database.
While this request is working :
INSERT INTO TABLE ( USERID, USERNAME) VALUES (1,"ok1")
The second one (when I am trying to insert multiple rows)is not working:
INSERT INTO TABLE ( USERID, USERNAME) VALUES (1,"ok1"),(2,"ok2")
I am getting this error :
Erreur SQL : ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"
You could use INSERT ALL
statement. For example:
INSERT ALL INTO mytable (column1, column2, column3) VALUES ('val1.1', 'val1.2', 'val1.3') INTO mytable (column1, column2, column3) VALUES ('val2.1', 'val2.2', 'val2.3') INTO mytable (column1, column2, column3) VALUES ('val3.1', 'val3.2', 'val3.3') SELECT * FROM dual;
Oracle does not support multi-row inserts. You need to write one insert
per row:
INSERT INTO TABLE ( USERID, USERNAME) VALUES (1,'ok1');
INSERT INTO TABLE ( USERID, USERNAME) VALUES (2,'ok2');
Additionally: string literals need to be enclosed in single quotes in SQL. Double quotes are for identifiers. "ok1"
is a column name, 'ok1'
is a string constant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With