I am using Oracle databases. I have an sql table
Cannot insert null Value into
INSERT INTO sysadm.PS_Z_STAGE_TEST_JE (EMPLID)
WHERE vc_plan_id IN ('PNC-RS','PNC-SO','PNC-ESPP');
The error message is exactly what it says it is. Your last_name column must be defined as not null. Therefore, you can't insert a null into it. Since you didn't define what to insert into the column in your insert, it tries to insert null by default and fails.
You must insert something into last name. I would suggest either a default string or an empty string if you can't get an actual last name to insert.
INSERT INTO sysadm.PS_Z_STAGE_TEST_JE (EMPLID, LAST_NAME) SELECT DISTINCT(emplid), 'N/A' FROM ps_vc_plan_mem WHERE vc_plan_id IN ('PNC-RS','PNC-SO','PNC-ESPP');
Alternatively, you could alter your table so that last_name is nullable.