1

Code below using sample data.

INSERT INTO ClientSeller VALUES
(1,'John Smith',88,1,'a',1),
(2,'Joe Smith',12,2,'b',2),
(3,'Warren ',15,2,'c',3),
(4,'Karen',69,6,'d',5),
(5,'Bob',45,6,'e',55),
(6,'Owen',65,6,'f',4),
(7,'Steve',25,5,'g',8),
(8,'Peter',24,55,'a',88),
(9,'Zoe',245,8,'b',8),
(10,'Jacky',244,2,'c',8);

and displays : ORA-00933: SQL command not properly ended Can any explain why this does not execute?

MT0
  • 143,790
  • 11
  • 59
  • 117
Steve
  • 11
  • 1
  • Look at this page and see if that helps. https://www.javatpoint.com/oracle-insert – Display name Feb 20 '20 at 16:06
  • Does this answer your question? [Best way to do multi-row insert in Oracle?](https://stackoverflow.com/questions/39576/best-way-to-do-multi-row-insert-in-oracle) – MT0 Dec 07 '20 at 00:43

1 Answers1

0

Based on your example, I created the following table.

Create table ClientSeller (
    identity number(2),
    name varchar2(50),
    employeno number(2),
    otherno number(1),
    letter char(1),
    otherotherno number(1) 
)

Then using the code below I can insert two of your sample rows into the table. Oracle has a very clunky syntax for inserting values into a table. You absolutely need the Insert All with separate INTO tablename VALUES xxxxx for each values set and then at the end you MUST add the select 1 from DUAL. See this example for more details.

Also, do not end your statements with the semicolon. In none of the example code provided here will you find such a character.

INSERT ALL
INTO ClientSeller VALUES (1,'John Smith',88,1,'a',1)
INTO ClientSeller VALUES (2,'Joe Smith',12,2,'b',2)
SELECT 1 from DUAL
Display name
  • 1,228
  • 1
  • 18
  • 29