Skip to content
Advertisement

SQL Command isnt running (invalid identifier) maybe SYSDATE?

I’m having a bit of trouble getting my command to run and I think that it has something to do with the SYSDATE command:

CREATE TABLE crimes (
  crime_ID NUMBER(9),
  criminal_ID NUMBER(6),
  classification CHAR(1),
  data_changed DATE DEFAULT SYSDATE,
  status CHAR(2),
  hearing_date DATE,
  appeal_cut_date DATE,
);

I get the ORA-00904: : invalid identifier error. Any fix?

Advertisement

Answer

The problem is the last field definition:

appeal_cut_date DATE,

Get rid of the comma and you’ll be fine.

db<>fiddle here

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement