Home > Mobile >  ORA-00933 sql command not properly ended ( in insert query )
ORA-00933 sql command not properly ended ( in insert query )

Time:02-13

I want the following query to be executed but I get an error:

insert into personal_info (case_type) 
values ('unknown') 
where case_description like '%normal%';

But when I am running the following query I get no errors:

select * 
from personal_info 
where case_description like '%normal%';

CodePudding user response:

It is not INSERT you're looking for, but UPDATE:

update personal_info set 
  case_type = 'unknown'
  where case_description like '%normal%';

If it were insert, then you'd just

insert into personal_info (case_type) values ('unknown');

as insert - using values - can't contain a where clause.

  • Related