on 05-12-2008 5:32 AM
Hi Experts,
I want to insert the current Date and time stamp in a field in the Oracle Database Table.
I am able to insert date but i am not able to insert the date with time stamp. Any Suggestions??
Thanks
Naveen
Naveen,
Do you want to get current date (from sysdate) with a specific format or transform a value containing a date/time value to insert it in ORACLE ?
Usually, you insert current datetimestamp in a date field using this :
TO_DATE(sysdate,'dd/mm/yyyy hh:mi:ss')
you may have to tweak the format pattern ('dd/mm....') according to your needs
if you want to transform a date, use something like this:
TO_DATE(your_date,your_format)
but make sure your format is compliant with your date, ie
TO_DATE('31/12/2008','MM/DD/YYYY') could raise error (litteral does not match) cuz ORACLE can't recognize 31 as a month pattern
Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
May be mismatch inbetween the source and target structures
and use this
to_date(sysdate,'dd/MM/yyyy')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Concatinate date with time and send it to the Oracle db table field.you can use the same function for time also like date.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does ur database table support the length and type of the field with timestamp? What error are u getting while trying to insert?
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prateek,
I am getting the follwoing error.
Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'CCS_INTERFACE.SAP_ELEC_METER' (structure 'Statement'): java.sql.SQLException: ORA-01830: date format picture ends before converting entire input string
My Data Type at Oracle database table is of type :: date
I am using CurrentDate function in XI but it doesnt give me time stamp.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.