-1

I am having an issue trying to insert data into a view I created, but it keeps telling me that the month I inserted was not valid.

INSERT INTO V_DRIVER
(DRIVER_LICENCE, SSN, FIRST_NAME, LAST_NAME, BIRTH_DATE, HIRE_DATE, STATE) 
VALUES( 'AR18263', '9576852', 'Jack', 'Mosby', '09/22/1975', '01/05/2000', 'CA') ;

Error message:Error report - ORA-01843: not a valid month

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110
  • 1
    By applying [`to_date`](https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions183.htm) with appropriate [date format](https://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements004.htm#i34924) not relying on the default – astentx Feb 25 '21 at 14:22

1 Answers1

1

Presumably, the columns are dates. So, use date constants. In Oracle, these use the DATE keyword and the YYYY-MM-DD format:

INSERT INTO V_DRIVER (DRIVER_LICENCE, SSN, FIRST_NAME, LAST_NAME, BIRTH_DATE, HIRE_DATE, STATE) 
    VALUES( 'AR18263', '9576852', 'Jack', 'Mosby',
            DATE '1975-09-22', DATE '2000-01-05', 'CA') ;
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786