Solved

Problem to insert

Posted on 2014-10-22
6
337 Views
Last Modified: 2014-10-23
Hi,
when doing this
insert into kyccusi (EVENT_TIMESTAMP,EVENT_TYPE,ITE_UNIT,BASIC_NO,ITE_NAME,OPEN_DATE,CLOSE_DATE,ITE_TYPE,DEFAULT_BRANCH,ITE_GROUP,PARENT_COUNTRY,RESIDENCE_COUNTRY,INDUSTRY) values ('2014-08-14 09:50:55.277','A','A2B','100133','P3 ','1993-08-27','1900-01-01','PI','CB  ','      ','A2','A2','OTHER PRIVATE PURPOSES             ')

Open in new window

within AS 400 DB2, I get this error.

insert into kyccusi                                                  
(EVENT_TIMESTAMP,EVENT_TYPE,ITE_UNIT,BASIC_NO,ITE_NAME,OPE 
N_DATE,CLOSE_DATE,ITE_TYPE,DEFAULT_BRANCH,ITE_GROUP,PARENT 
_COUNTRY,RESIDENCE_COUNTRY,INDUSTRY) values ('2014-08-14             
09:50:55.277','A','A2B','100133','P3                       
','1993-08-27','1900-01-01','PI','CB  ','      ','A2','A2','OTHER    
PRIVATE PURPOSES             ')                                      

Open in new window

Syntax of date, time, or timestamp value not valid.                  

how to correct the above?
0
Comment
Question by:HuaMinChen
  • 3
  • 2
6 Comments
 
LVL 27

Expert Comment

by:tliotta
ID: 40398577
How is the statement executed? The timestamp and date values work for me, but I don't know your database definitions nor anything about how your statement is processed.

Tom
0
 
LVL 10

Author Comment

by:HuaMinChen
ID: 40398601
Many thanks. I use "strsql" to run that. how to extract the relevant table structure to you?
0
 
LVL 10

Author Comment

by:HuaMinChen
ID: 40398630
Sorry. Here is the table structure
 Seq  Field              File               Type                 Length  Scale  
      EVENT_TIMESTAMP    KYCCUSI            TIMESTAMP                           
      EVENT_TYPE         KYCCUSI            CHARACTER                 1         
      ITE_UNIT           KYCCUSI            CHARACTER                 3         
      BASIC_NO           KYCCUSI            CHARACTER                 6         
      ITE_NAME           KYCCUSI            CHARACTER                35         
      OPEN_DATE          KYCCUSI            DATE                                
      CLOSE_DATE         KYCCUSI            CHARACTER                10         
      ITE_TYPE           KYCCUSI            CHARACTER                 2         
      DEFAULT_BRANCH     KYCCUSI            CHARACTER                 4         
      ITE_GROUP          KYCCUSI            CHARACTER                 6         
      PARENT_COUNTRY     KYCCUSI            CHARACTER                 2         
      RESIDENCE_COUNT >  KYCCUSI            CHARACTER                 2         
      INDUSTRY           KYCCUSI            CHARACTER                35         
      OFFICER            KYCCUSI            CHARACTER                35         
      UPDATE_STATUS      KYCCUSI            CHARACTER                 1       

Open in new window

0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 10

Author Comment

by:HuaMinChen
ID: 40398680
Any other help? thanks
0
 
LVL 18

Accepted Solution

by:
daveslash earned 500 total points
ID: 40399640
What is the date-format and time-format in you interactive SQL session. (You can check that using F13 and select 1 for "Change session attributes"). For example, mine is *ISO.

-- DaveSlash
0
 
LVL 18

Expert Comment

by:daveslash
ID: 40399665
I believe your timestamp value should be: ''2014-08-14-09.50.55.277000'
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now