Solved

Solve my Time stamp Problem in oracle

Posted on 2011-02-10
6
772 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
ID: 34868739
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
ID: 34869932
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
ID: 34870299
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
ID: 34870302
to_timestamp('12-01-2010 22:12:12','DD-MM-RRRR  HH24:MI:SS')
0
 
LVL 13

Expert Comment

by:agarwalrahul
ID: 34931687
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
ID: 34935560
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
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 video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

932 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

15 Experts available now in Live!

Get 1:1 Help Now