The SQL Error: ORA-00904: : invalid identifier is probably being caused because your FOREIGN KEYs are referencing a column that does not exist - check that the column names are spelt correctly and that should solve it (and then your CREATE TABLE statement will work).

CREATE TABLE ArtistMember (
  user_ID INT PRIMARY KEY
);

CREATE TABLE FollowerMember (
  user_ID INT PRIMARY KEY
);

CREATE TABLE pledge (
    pledge_ID            INT CONSTRAINT  XPKPledge PRIMARY KEY,
    pledge_endDate       DATE NULL,
    pledge_startDate     DATE NULL,
    pledge_amount        DECIMAL(9,2) NULL  CONSTRAINT  Currency_1322638346 CHECK (pledge_amount >= 0),
    artist_userID        INT NOT NULL CONSTRAINT gets REFERENCES ArtistMember (user_ID),
    follower_userID      INT NOT NULL CONSTRAINT makes REFERENCES FollowerMember (user_ID)
);

INSERT INTO ArtistMember VALUES ( 85275 );
INSERT INTO FollowerMember VALUES( 88128 );
INSERT INTO pledge VALUES(
  559,
  NULL,              -- Use NULL and not 'NULL'
  DATE '2016-02-01', -- Use a Date literal and not a string literal
  3850,
  85275,
  88128
);

If you just use the string in '1-FEB-2016' then Oracle will implicitly try to convert the string literal using the TO_DATE() function with the NLS_DATE_FORMAT session parameter as the format mask. If they match then it will work but this is a client variable so can be changed and then the query will break without the code having changed (and be a pain to debug). The simple answer is to ensure that you compare date value by either using TO_DATE() and specifying the format mask (as per the query above) or to use an ANSI date literal DATE '2016-02-01' (which is independent of the NLS settings).

Answer from MT0 on Stack Overflow
🌐
w3resource
w3resource.com › sql › insert-statement › insert-null.php
Sql inserting NULL values - w3resource
-- INSERT INTO statement begins INSERT INTO agents -- Specifies the table 'agents' where the data will be inserted VALUES ("A001","Jodi","London",.12,NULL); -- Specifies the values to be inserted into each column of the table: -- "A001" will be inserted into the 'agent_code' column (assuming it's a string data type) -- "Jodi" will be inserted into the 'agent_name' column -- "London" will be inserted into the 'working_area' column -- .12 will be inserted into the 'commission' column (assuming it's a numeric data type) -- NULL will be inserted into the 'salary' column, assuming it allows NULL values ... This SQL code attempts to perform an INSERT operation into the 'agents' table.
Top answer
1 of 2
9

The SQL Error: ORA-00904: : invalid identifier is probably being caused because your FOREIGN KEYs are referencing a column that does not exist - check that the column names are spelt correctly and that should solve it (and then your CREATE TABLE statement will work).

CREATE TABLE ArtistMember (
  user_ID INT PRIMARY KEY
);

CREATE TABLE FollowerMember (
  user_ID INT PRIMARY KEY
);

CREATE TABLE pledge (
    pledge_ID            INT CONSTRAINT  XPKPledge PRIMARY KEY,
    pledge_endDate       DATE NULL,
    pledge_startDate     DATE NULL,
    pledge_amount        DECIMAL(9,2) NULL  CONSTRAINT  Currency_1322638346 CHECK (pledge_amount >= 0),
    artist_userID        INT NOT NULL CONSTRAINT gets REFERENCES ArtistMember (user_ID),
    follower_userID      INT NOT NULL CONSTRAINT makes REFERENCES FollowerMember (user_ID)
);

INSERT INTO ArtistMember VALUES ( 85275 );
INSERT INTO FollowerMember VALUES( 88128 );
INSERT INTO pledge VALUES(
  559,
  NULL,              -- Use NULL and not 'NULL'
  DATE '2016-02-01', -- Use a Date literal and not a string literal
  3850,
  85275,
  88128
);

If you just use the string in '1-FEB-2016' then Oracle will implicitly try to convert the string literal using the TO_DATE() function with the NLS_DATE_FORMAT session parameter as the format mask. If they match then it will work but this is a client variable so can be changed and then the query will break without the code having changed (and be a pain to debug). The simple answer is to ensure that you compare date value by either using TO_DATE() and specifying the format mask (as per the query above) or to use an ANSI date literal DATE '2016-02-01' (which is independent of the NLS settings).

2 of 2
0

Insert an empty string '' to a NUMBER column, Oracle will insert NULL.

For example, col_2 has data type is date field or number(12,0) (any datatype what not date field), SQL statement set NULL value for col_2 like this:

insert into foo (col_1, col_2) values ('abc', '');

or

insert into foo (col_1, col_2) values ('abc', NULL);

(it is NULL, not 'NULL' or "NULL")

🌐
GeeksforGeeks
geeksforgeeks.org › sql › how-to-insert-rows-with-null-values-in-sql
How to Insert Rows with NULL Values in SQL? - GeeksforGeeks
July 23, 2025 - INSERT INTO WORKER VALUES('SAM','ONTARIO',NULL); INSERT INTO WORKER VALUES('TIM',NULL,56); INSERT INTO WORKER VALUES(NULL,'CAIRO',43); INSERT INTO WORKER VALUES(NULL,'MUMBAI',NULL); INSERT INTO WORKER VALUES(NULL,NULL,NULL);
🌐
ORACLE-BASE
oracle-base.com › articles › 23 › default-on-null-for-insert-and-update-23
DEFAULT ON NULL FOR INSERT AND UPDATE in Oracle Database 23ai/26ai - ORACLE-BASE
Type ----------------------------------------- -------- ---------------------------- ID NUMBER DESCRIPTION1 NOT NULL VARCHAR2(15) DESCRIPTION2 NOT NULL VARCHAR2(15) SQL> update t1 set description1 = null, description2 = null; set description1 = null, * ERROR at line 2: ORA-01407: cannot update ("TESTUSER1"."T1"."DESCRIPTION1") to NULL SQL> In Oracle 23ai/26ai we have the ability to define a column as DEFAULT ON NULL FOR INSERT AND UPDATE, so the default value is applied during update operations if an explicit null value is assigned.
🌐
Quora
quora.com › How-do-you-insert-null-to-certain-columns-in-Oracle-SQL-Oracle-SQL-insert-development
How to insert null to certain columns in Oracle (SQL, Oracle, SQL insert, development) - Quora
Answer (1 of 3): As suggested by Suryakant Mangalgi just add NULL in the value clause OR A column can be given a default value using the DEFAULT keyword. The DEFAULT keyword provides a default value to a column when the Oracle INSERT INTO statement ...
🌐
Database Journal
databasejournal.com › home › features
Working with NULL Values in SQL | DatabaseJournal.com
March 9, 2023 - The phone_number, salary, commission_pct, and manager_id columns can contain NULL values. This is achieved using the NULL keyword. ... You can insert NULL values into a table that allows NULL types by using the NULL keyword.
🌐
GeeksforGeeks
geeksforgeeks.org › sql › how-to-set-a-column-value-to-null-in-sql
How to Set a Column Value to Null in SQL? - GeeksforGeeks
NULL: It represents the NULL value in SQL. WHERE: This statement has an optional part that specifies which rows should be updated. column_name: The name of the column you want to update should be replaced here. Firstly, let's create a table using the CREATE TABLE command: -- create a table CREATE TABLE students (Sr_No integer,Name varchar(20), Gender varchar(2)); -- insert some values INSERT INTO students VALUES (1, 'Nikita', 'F'); INSERT INTO students VALUES (2, 'Akshit', 'M'); INSERT INTO students VALUES (3, 'Ritesh', 'F'); INSERT INTO students VALUES (4, 'Himani', 'F'); -- fetch some values SELECT * FROM students ;
Published   July 23, 2025
Find elsewhere
🌐
Quora
quora.com › Can-we-insert-null-in-the-number-field-in-Oracle
Can we insert null in the number field in Oracle? - Quora
Answer (1 of 2): Yes, you can insert NULL in a Number field (or column). if only this column doesn’t have NOT NULL constraint on this field. If you are not mentioning a column in INSERT statement, oracle by default considers NULL values for that column. A NULL value can be overridden with defau...
🌐
SQLines
sqlines.com › oracle › insert_empty_string_to_numeric_column
Inserting Empty String to Numeric Column - Oracle to SQL Server Migration - SQLines Tools
Oracle allows you to use a string literal containing a numeric value to insert data into a NUMBER column without explicit data type casting. But if you attempt to insert an empty string ('') to a NUMBER column, Oracle inserts NULL.
🌐
Tutorialspoint
tutorialspoint.com › sql › sql-null-values.htm
SQL - NULL Values
Here, NOT NULL signifies that column should always accept an explicit value of the given data type. You can insert NULL values into the columns where we did not use NOT NULL. Let us create a table with the name CUSTOMERS in the SQL database using the CREATE statement as shown in the query below −
🌐
Quora
quora.com › How-do-you-add-null-values-in-SQL
How to add null values in SQL - Quora
Answer (1 of 3): NULL values are handled differently depending on whether they are in the context of a tuple or a set. In the case of a tuple: (e.g. 1 + NULL), the result is always NULL. This is because if any part of a tuple is missing or unknown then the entire tuple cannot be known and hence m...
🌐
Embarcadero
docwiki.embarcadero.com › InterBase › 2020 › en › Inserting_Rows_with_NULL_Column_Values
Inserting Rows with NULL Column Values - InterBase
In InterBase a column is set to NULL by specifying NULL for the column in the INSERT statement. For example, the following statement stores a row into the DEPARTMENT table, assigns the values of host variables to some columns, and assigns a NULL value to other columns: EXEC SQL INSERT INTO DEPARTMENT (DEPT_NO, DEPARTMENT, HEAD_DEPT, MNGR_NO, BUDGET, LOCATION, PHONE_NO) VALUES (:dept_no, :dept_name, NULL, NULL, 1500000, NULL, NULL);
🌐
Scriptcase
forum.scriptcase.net › applications › forms
how to insert null instead of 0 for integer data type? - Forms - Scriptcase Low-code
September 3, 2014 - Hi all, Im using scriptcase v8 and oracle as database. When creating a form, i will have items withe integer data type via front end (number in oracle back end). but there are occasions where i don’t need this field to …
🌐
Oracle
forums.oracle.com › ords › apexds › post › insert-null-value-on-date-column-1948
insert null value on date column - Oracle Forums
September 11, 2015 - hi how can i insert null value in date column INSERT INTO EMP(HIREDATE) VALUES(TO_DATE('NULL','DD/MM/YYYY HH24:MI:SS');
🌐
Oracle
forums.oracle.com › ords › apexds › post › insert-data-into-the-column-which-is-having-null-values-2452
Insert data into the column which is having null values. - Oracle ...
February 16, 2011 - Hi, I have a column called "Classification_CD" .This column is having NULL values.I want to insert the data into this column. I tried to write the query as follows. But it is showing the me...
🌐
Reddit
reddit.com › r/sql › insert into if not null
r/SQL on Reddit: insert into if not null
July 4, 2019 -

Hello everyone, I just can't figure out the, as I guess, very easy solution to my problem. (the worst part is, I didn't find anything good / related via google for example).

I want to insert data into a table2, IF, ond only IF a specific Value from #table 1 is NOT NULL. If this Value is NULL, I don't want to insert anything at all.

Like:

CASE #table1.value is not null THEN

Insert into table2 (values) select * from table1

ELSE 'do nothing'

END

But it is not working. can anybody point my into the right direction please ? :)