Home » Developer & Programmer » JDeveloper, Java & XML » inserting current date from xml (Oracle 10g)
inserting current date from xml [message #580272] Fri, 22 March 2013 03:16 Go to next message
sss111ind
Messages: 508
Registered: April 2012
Location: India
Senior Member

Hi All,

How can we insert current date which is present in xml node into a column having date datatype.

Regards,
Nathan
Re: inserting current date from xml [message #580273 is a reply to message #580272] Fri, 22 March 2013 03:17 Go to previous messageGo to next message
Michel Cadot
Messages: 60044
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Just go to our XML forum and you will have examples.

That says, how someone who is there since more than 10 years is unable to post in the correct way?

Regards
Michel
Re: inserting current date from xml [message #580274 is a reply to message #580273] Fri, 22 March 2013 03:26 Go to previous messageGo to next message
Littlefoot
Messages: 19901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
10 years? What 10 years?
Re: inserting current date from xml [message #580276 is a reply to message #580274] Fri, 22 March 2013 03:35 Go to previous messageGo to next message
sss111ind
Messages: 508
Registered: April 2012
Location: India
Senior Member

Hi Michel,

I did not find any solution for inserting a date column from an xml to oracle.Can you please give an example or link where I have to follow.And what should be in the node.
I tried like
<startdate>2002-05-30T09:00:00</startdate> --getting litteral string does not match
<startdate>2002-05-30 09:00:00</startdate> --date format picture ends before converting entire string
<startdate>to_date('2002-05-30 09:00:00','yyyy-mm-dd hh:mi:ss')</startdate> --getting non numeric was found where numeric was excepected.

Please help me.
Regards,
Nathan

[Updated on: Fri, 22 March 2013 03:40]

Report message to a moderator

Re: inserting current date from xml [message #580277 is a reply to message #580274] Fri, 22 March 2013 03:37 Go to previous messageGo to next message
Michel Cadot
Messages: 60044
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Doh! How could I see a 0 in place of a 1? I don't know... really I don't know.

Well, can change the sentence to "how someone who has posted almost 200 times...". Smile

Regards
Michel
Re: inserting current date from xml [message #580291 is a reply to message #580277] Fri, 22 March 2013 05:04 Go to previous messageGo to next message
sss111ind
Messages: 508
Registered: April 2012
Location: India
Senior Member

Hi All Thanks,

I have converted my date data type to timestamp. So now from xml end it's coming like
<start>09-oct-2012 09:23:67 pm</start>

the value is string and now It's working fine.


Sorry above all things are working fine also because extra quote is coming at beginning and ending so it was failing that time.

Regards,
Nathan

[Updated on: Fri, 22 March 2013 05:54]

Report message to a moderator

Re: inserting current date from xml [message #580298 is a reply to message #580291] Fri, 22 March 2013 08:51 Go to previous message
Michel Cadot
Messages: 60044
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Regards
Michel
Previous Topic: How to generate the XML string from the nested table
Next Topic: Lib path
Goto Forum:
  


Current Time: Wed Dec 24 23:50:37 CST 2014

Total time taken to generate the page: 0.13935 seconds