Solved

Solve my Time stamp Problem in oracle

Posted on 2011-02-10
6
768 Views
Last Modified: 2013-12-19
Solve my Time stamp Problem in oracle

VALUES('1','1','1','1','1',TO_TIMESTAMP(TO_CHAR('02-02-2011 12:12:16','DD-MM-YYYY HH24:MI:SS')),

in time stamp it would provide invalid number

could you please give me the correct syntax in Timestam
0
Comment
Question by:stmani2005
6 Comments
 
LVL 28

Expert Comment

by:Naveen Kumar
Comment Utility
try this :

VALUES('1','1','1','1','1',TO_TIMESTAMP('02-02-2011 12:12:16.123456789','DD-MM-YYYY HH24:MI:SS.XFF'))

0
 
LVL 8

Author Comment

by:stmani2005
Comment Utility
please correct this one it would throw invalid number in time stamp format

INSERT INTO com_ebpp_bill_reg_hst
(EBR_LV_CODE_ST
,EBR_BILLER_CODE_ST,
EBR_BILL_UPLOAD_TYPE_ST,
EBR_PAY_PRES_FLAG_ST,
EBR_ACTIVE_STATUS_FLAG_ST,
EBR_BUS_DATE_DT,
EBR_MAKER_ID_ST,
EBR_MAKER_DATETIME_DT,
EBR_CHECKER_ID_ST,
EBR_CHECKER_DATETIME_DT,
EBR_CHANNEL_SOURCE_ST,
EBR_RECRD_STATUS_ST,
EBR_MAKER_REMARKS_ST,
EBR_CHECKER_REMARKS_ST,
EBR_WORK_BR_ID_DO)
VALUES('1','1','1','1','1',to_timestamp(TO_CHAR('12-01-2010 22:12:12' ,'DD-MM-RRRR HH24:MI:SS'),'DD-MM-RRRR  HH24:MI:SS')

,
'1',
sysdate,
'1',sysdate,'y','y','y','y',1)
0
 
LVL 73

Expert Comment

by:sdstuber
Comment Utility
Don't put to_char on a string

TO_CHAR('12-01-2010 22:12:12'

'12-01-2010 22:12:12'  is already a string
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
Comment Utility
to_timestamp('12-01-2010 22:12:12','DD-MM-RRRR  HH24:MI:SS')
0
 
LVL 13

Expert Comment

by:agarwalrahul
Comment Utility
Try this

VALUES('1','1','1','1','1',TO_DATE('02-02-2011 12:12:16','DD-MM-YYYY HH24:MI:SS'),
0
 
LVL 28

Expert Comment

by:Naveen Kumar
Comment Utility
did you try what i suggested ?
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

744 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

13 Experts available now in Live!

Get 1:1 Help Now