Results 1 to 4 of 4

Thread: Ora-02436:

  1. #1
    Join Date
    Mar 2004
    Posts
    17

    Unanswered: Ora-02436:

    Hi,

    I am creating a table

    CREATE TABLE EMPLOYEE( EMPID NUMBER(10) PRIMARY KEY,
    EMPNAME VARCHAR2(30) NOT NULL,
    EMPLASTNAME VARCHAR2(40) NOT NULL,
    EMP_DOB DATE CONSTRAINT CN NOT NULL
    CONSTRAINT CD CHECK (EMP_DOB > '20-JUN-74'))

    And am getting the following error
    ORA-02436: date or system variable wrongly specified in CHECK constraint

    No matter what I do .. am not not able to get around the same.

    Thanks
    Cyberbob

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    > '20-JUN-74'
    Is NOT a "date" it is a string!
    Try using TO_DATE

  3. #3
    Join Date
    Mar 2004
    Posts
    17
    Originally posted by anacedent
    > '20-JUN-74'
    Is NOT a "date" it is a string!
    Try using TO_DATE
    Sorry for bothering again but this

    CONSTRAINT CD CHECK (EMP_DOB > TO_DATE('20-JUN-74','DD-MON-YY','NLS_DATE_LANGUAGE = American'))

    doesnt work as well.

    However the query :
    SELECT TO_DATE('20-JUN-74','DD-MON-YY','NLS_DATE_LANGUAGE = American') FROM DUAL; works fine!

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    1 CREATE TABLE EMPLOYEE( EMPID NUMBER(10) PRIMARY KEY,
    2 EMPNAME VARCHAR2(30) NOT NULL,
    3 EMPLASTNAME VARCHAR2(40) NOT NULL,
    4 EMP_DOB DATE CONSTRAINT CN NOT NULL
    5* CONSTRAINT CD CHECK (EMP_DOB > to_date('20-Jun-1974','DD-MON-YYYY')))
    abc@DB.ARES.ABC.COM>

    Table created.

    PEBKAC?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •