Cannot insert data into a table

I successfully created a table using this command

create  table Person(
  first_name varchar(25) not null,
  last_name varchar(25) not null,
  persoin_id number not null, 
  birth_date date,  
  country varchar (25),
  salary  number);

and now I want to insert data into this table

insert into  Person(persoin_id,first_name,last_name,salary,birth_date,country)
 values(100,'dato','datuashvili',350,to_date('01/01/10','DD/MM/YY'),'georgia');
 values(101,'irakli','oqruashvili',350,to_date('01/03/10','DD/MM/YY'),'georgia');

the first row is inserted, but the problem is with the second row

1 rows inserted.

Error starting with line 10 in the command:
values ​​(101, 'Irakli', 'oqruashvili', 350, to_date ('01 / 03/10 ',' DD / MM / YY '),' Georgia ')
Error report:
Unknown team

Please help me identify what is the problem? thank

+5
source share
3 answers

If you are on an RDBMS that supports multi-line inserts in one INSERT:

insert into  Person(persoin_id,first_name,last_name,salary,birth_date,country)
   values
 (100,'dato','datuashvili',350,to_date('01/01/10','DD/MM/YY'),'georgia') , 
                                                       --- comma here ---^
 (101,'irakli','oqruashvili',350,to_date('01/03/10','DD/MM/YY'),'georgia') ;
 ^--- no "values" here

(, Oracle), :

insert into  Person(persoin_id,first_name,last_name,salary,birth_date,country)
   values
 (100,'dato','datuashvili',350,to_date('01/01/10','DD/MM/YY'),'georgia') ;
                                                  --- as it was  here ---^

insert into  Person(persoin_id,first_name,last_name,salary,birth_date,country)
   values
 (101,'irakli','oqruashvili',350,to_date('01/03/10','DD/MM/YY'),'georgia') ;

:

insert into  Person(persoin_id,first_name,last_name,salary,birth_date,country)
   select
 (100,'dato','datuashvili',350,to_date('01/01/10','DD/MM/YY'),'georgia') 
       from dual
   union all select
 (101,'irakli','oqruashvili',350,to_date('01/03/10','DD/MM/YY'),'georgia') 
       from dual
 ;
+6

2 insert ...

insert into  Person(persoin_id,first_name,last_name,salary,birth_date,country)
  values(100,'dato','datuashvili',350,to_date('01/01/10','DD/MM/YY'),'georgia');

insert into  Person(persoin_id,first_name,last_name,salary,birth_date,country)
  values(101,'irakli','oqruashvili',350,to_date('01/03/10','DD/MM/YY'),'georgia')
+2

Do you have ;at the end:

values(100,'dato','datuashvili',350,to_date('01/01/10','DD/MM/YY'),'georgia');
                                                                             ^

change it to ,, and also lose valuesfrom the next line. You only need one valuesfor each insert.

+1
source

All Articles