SQL Problem: ORA-00926: missing VALUES keyword error occurs when the VALUES clause in the insert statement is missing. The VALUES keyword identifies the VALUES clause. The VALUES clause specifies the values to be stored in the table. If the VALUES clause is missing from the insert statement, Oracle will fail to execute it. The error SQL Problem: ORA-00926: missing VALUES keyword will be thrown by Oracle.

There are two methods for inserting data into the table. The values are added in the VALUES clause. The insert statement will save the values from the VALUES clause. The other option is to transfer the data from another table. The insert statement will include a select query to read data from the source table. The select query will retrieve the required data from the tables, whereas the insert state will insert the data into the tables. The error SQL Problem: ORA-00926: missing VALUES keyword will be throw if none of the method is used in the insert statement.



When the ORA-00926 error occurs

The error will be thrown if you create an insert statement and run it without the VAUES clause. The insert statement will look for the VALUES clause to find all of the values that need to be saved in the selected table. If the VALUES clause is not there, the insert statement is unable to retrieve the values and fails to execute. The error SQL Problem: ORA-00926: missing VALUES keyword will be shown.

Program

insert into employee;

Error

Error starting at line : 25 in command -
insert into employee 
Error at Command Line : 25 Column : 21
Error report -
SQL Error: ORA-00926: missing VALUES keyword
00926. 00000 -  "missing VALUES keyword"
*Cause:    
*Action:


Root Cause

The VALUES clause is missing in the insert statement, which is the underlying cause of the problem. The VALUES keyword identifies the VALUES clause. The values to be saved in the database will not be accessed if the VALUES keyword is not included in the insert statement. As a result, the insert statement will not execute. The Oracle error message “ORA-00926: missing VALUES keyword” will appear.



Solution 1

If the VALUES clause is missing from the insert statement, the VALUES clause should be inserted. All of the values that will be saved in the table must be added. The VALUES keyword should be preceded by a list of values. The error “ORA-00926: missing VALUES keyword” will be addressed if you include the VALUES clause in the insert statement.

Program

insert into employee ;

Error

Error starting at line : 25 in command -
insert into employee 
Error at Command Line : 25 Column : 21
Error report -
SQL Error: ORA-00926: missing VALUES keyword
00926. 00000 -  "missing VALUES keyword"

Solution

insert into employee values(4,'kim',2);


Solution 2

If the VALUES clause in the insert statement is missing, it may be feasible to insert data from another table. The insert statement should include a select query to retrieve data from another table. The select query will get items from another table, whereas the insert statement will insert them into the current table. The issue may be fixed by include the select query in the insert statement.

Program

insert into employee ;

Error

Error starting at line : 25 in command -
insert into employee 
Error at Command Line : 25 Column : 21
Error report -
SQL Error: ORA-00926: missing VALUES keyword
00926. 00000 -  "missing VALUES keyword"

Solution

insert into employee select * from manager;



Leave a Reply