-1

Im trying to insert data into a table i created on Oracle SQL live. I was able to enter the data in one row at a time but when i try to enter it all at the same time, i get an error message that says SQL command not properly ended. Im using the code below. I don't know what i'm doing wrong:

Insert into PET_OWNER (OwnerID, OwnerLastName , OwnerFirstName , OwnerPhone , OwnerEmail) 
Values (1, 'Downs' , 'Marsha' , '555-537-8765' , '[email protected]'), 
Values (2 , 'James' , 'Richard' , '555-537-7654' , '[email protected]'),  
Values (3 , 'Frier' , 'Liz' , '555-537-6543' , '[email protected]'),  
Values (4 , 'Trent' , 'Miles' , '[email protected]');  
Kaushik Nayak
  • 30,772
  • 5
  • 32
  • 45

1 Answers1

1

Try like below

    Insert into PET_OWNER (OwnerID, OwnerLastName , OwnerFirstName , OwnerPhone , OwnerEmail) 
    select 1, 'Downs' , 'Marsha' , 
    '555-537-8765' , '[email protected]' from dual
    union all
    select 2 , 'James' , 'Richard' , 
    '555-537-7654' , '[email protected]' from dual
    union all
    select 3 , 'Frier' , 'Liz' ,
   '555-537-6543', '[email protected]' from dual
    union all
    select 4 , 'Trent' , 'Miles' , 
    null,'[email protected]'  from dual

Demo in fiddle

Zaynul Abadin Tuhin
  • 31,407
  • 5
  • 33
  • 63