views:

37

answers:

2

Hello I am trying to run this oracle query in toad and I am getting the above mentioned error. How can I fix it?

INSERT
INTO IMAGE
  (
    IMAGE_SEQ_NO,BLDG_ID,BU_ID,DT_TAKEN,
    NEGATIVE_NO,FILENAME,FILE_TYPE,DESCRIPTION,
    STORAGE_SRCE,DOC_ID,PICT_SRCE_TYPE,TAKE_BY,
    INFO_SRCE,DOC_REF_NO,DOC_TYPE,SUB_DOC_TYPE,
    DDW_IMAGE_DOC_STATUS,SUB_IMAGE_DOC_STTS_DT,CPVI,FY,
    CY,HPD_PRIVACY_FLG,EXT_PRIVACY_FLG,SCAN_DEVICE,
    ADD_BY,ADD_DT,CHG_BY,CHG_DT,
    REC_STTS,REC_STTS_REASON,REC_STTS_DT
  )
  VALUES
  (
    1087986,43633,78,'30/June/2010 12:15:15 PM',
    NULL,NULL,0,NULL,
    0,2065041,0,0,0,
    NULL,1,204,0,
    '30/June/2010 12:15:15 PM','1',0,0,
    NULL,NULL,NULL,'JKF',
    '30/June/2010 12:15:15 PM','JKF','30/June/2010 12:15:15 PM',1,
    NULL,'30/June/2010 12:15:15 PM'
  );
A: 

Probably the date format does not match the setting for your connection.

Frank
+3  A: 

In general it is a good idea to use a specific format when inserting dates into Oracle, using the TO_DATE function: See http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions183.htm

If you want to use a standard format for everything, use NLS_DATE_FORMAT:

alter session  set NLS_DATE_FORMAT='DD-MM-YYYY'
MatthieuF
In this case, perhaps use `NLS_DATE_FORMAT='DD/Month/YYYY HH:MI:SS PM'`
Jeffrey Kemp