DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Inserting of date values

Threaded View

  1. #1
    Join Date
    Mar 2008
    Posts
    7

    Inserting of date values

    Hi, i wonder if anyone can help me. I've created some tables and i would like to enter some data into them, they go ok into the first and second tables fine, but in the third for the date value it continues to bring up errors!

    Code:
    Table 1
    CREATE TABLE JDcustomers
    (crefno NUMBER(4) NOT NULL,
    cname VARCHAR2(20) NOT NULL,
    cadd1 VARCHAR2(20) NOT NULL,
    cdd2 VARCHAR2(20),
    PRIMARY KEY (crefno));
    
    Table 2
    CREATE TABLE JDvehicles
    (regno VARCHAR2(7) NOT NULL,
    v_crefno NUMBER(4) NOT NULL,
    PRIMARY KEY (regno),
    FOREIGN KEY(v_crefno) REFERENCES customers(crefno));
    
    Table 3
    CREATE TABLE JDrepairs
    (jobcode NUMBER(6) NOT NULL,
    regno VARCHAR2(7) NOT NULL,
    datein DATE NOT NULL,
    finish DATE,
    bayno NUMBER(2) NOT NULL,
    PRIMARY KEY (jobcode),
    FOREIGN KEY(regno) REFERENCES vehicles);
    
    Insert into table 1
    INSERT INTO JDcustomers 
    VALUES ('4444','INDUSTRIAL CLEANING','97 PARK ROAD','SOUTHAMPTON');
    INSERT INTO JDcustomers 
    VALUES ('5555','FORK TRUCK SERVICES','28 CASTLE STREET','WINCHESTER');
    
    Insert into table 2
    INSERT INTO JDvehicles
    VALUES ('HG07VEB',4444);
    INSERT INTO JDvehicles
    VALUES ('HB57DIW',4444);
    INSERT INTO JDvehicles
    VALUES ('HF57NAR',4444);
    INSERT INTO JDvehicles
    VALUES ('HF57RST',4444);
    INSERT INTO JDvehicles
    VALUES ('RK06TEC',5555);
    INSERT INTO JDvehicles
    VALUES ('RK56ADI',5555);
    INSERT INTO JDvehicles
    VALUES ('RN56UME',5555);
    INSERT INTO JDvehicles
    VALUES ('RD56SPE',5555);
    
    Insert into table 3INSERT INTO JDrepairs 
    VALUES (139087,'RK06TEC','03-APR-08','06-APR-08',15);
    INSERT INTO JDrepairs 
    VALUES (139587,'HG07VEB','10-APR-08','11-APR-08',11);
    INSERT INTO JDrepairs 
    VALUES (140187,'HB57DIW','13-APR-08',,04);
    INSERT INTO JDrepairs 
    VALUES (139987,'RK56ADI','05-MAY-08','10-MAY-08',12);
    INSERT INTO JDrepairs 
    VALUES (140387,'HF57NAR','16-MAY-08',,15);
    INSERT INTO JDrepairs 
    VALUES (140087,'RN56UME','09-MAY-08','14-MAY-08',01);
    INSERT INTO JDrepairs 
    VALUES (140287,'RD56SPE','02-APR-08','03-APR-08',11);
    These are the errors it produces;

    Code:
    INSERT INTO JDrepairs
    *
    
    ERROR at line 1:
    ORA-02291: integrity constraint (AUSER.SYS_C00977449) violated - parent key not found 
    
    VALUES (140187,'HB57DIW','13-APR-08',,04)
                                         *
    
    ERROR at line 2:
    ORA-00936: missing expression
    Can anyone help me please?
    Last edited by Drewery86; 03-25-2008 at 01:09 PM.

Posting Permissions

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


Click Here to Expand Forum to Full Width