-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' , 'Marsha.downs@somewhere.com'), 
Values (2 , 'James' , 'Richard' , '555-537-7654' , 'Richard.James@somewhere.com'),  
Values (3 , 'Frier' , 'Liz' , '555-537-6543' , 'Liz.Frier@somewhere.com'),  
Values (4 , 'Trent' , 'Miles' , 'Miles.Trent@somewhere.com');  
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' , 'Marsha.downs@somewhere.com' from dual
    union all
    select 2 , 'James' , 'Richard' , 
    '555-537-7654' , 'Richard.James@somewhere.com' from dual
    union all
    select 3 , 'Frier' , 'Liz' ,
   '555-537-6543', 'Liz.Frier@somewhere.com' from dual
    union all
    select 4 , 'Trent' , 'Miles' , 
    null,'Miles.Trent@somewhere.com'  from dual

Demo in fiddle

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