Leave column out of Oracle insert statement

I have an insert statement that I am trying to run against an Oracle database. The insert statement is very simple, and I only want to insert a value into one column. The table itself has more than one column, but I am only interested in filling one of the columns with data. The format of my query is similar to the one below:

insert into myTable (col1) Values (val1)

However, this throws the following error:

ORA-00904: "col1": invalid identifier

I’ve checked to make sure that the column is named correctly, and my only other thought is that something is wrong with my syntax. There are no constraints on the table such as primary keys. Is it possible to only insert values into certain columns when executing an insert statement in Oracle?

Source: oracle

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.