Home » SQL & PL/SQL » SQL & PL/SQL » How to insert value in column which has date datatype? (11g)
icon5.gif  How to insert value in column which has date datatype? [message #568467] Fri, 12 October 2012 01:30 Go to next message
vikashkrburnwal@gmail.com
Messages: 61
Registered: October 2012
Location: Bangalore
Member
Hi sir,

i am having one column name pdate with date datatype

i am updating here value like this

update table1 set pdate='15-10-2012' where id=1;

but showing error: not a valid month.

how to update this.

thanks
Re: How to insert value in column which has date datatype? [message #568468 is a reply to message #568467] Fri, 12 October 2012 01:32 Go to previous messageGo to next message
Michel Cadot
Messages: 57612
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
TO_DATE with format.

Regards
Michel

[Updated on: Fri, 12 October 2012 01:33]

Report message to a moderator

Re: How to insert value in column which has date datatype? [message #568469 is a reply to message #568468] Fri, 12 October 2012 01:37 Go to previous messageGo to next message
vikashkrburnwal@gmail.com
Messages: 61
Registered: October 2012
Location: Bangalore
Member
Hi michel

i went through this link but didn't get exact thing.

could you explain about that.

thanks
Re: How to insert value in column which has date datatype? [message #568470 is a reply to message #568469] Fri, 12 October 2012 01:57 Go to previous messageGo to next message
muralikri
Messages: 638
Registered: August 2011
Location: chennai
Senior Member

Hey Try like...
update emp set modified_on=to_date('15-10-2012','dd-mm-yyyy') where empno=7566 
Re: How to insert value in column which has date datatype? [message #568471 is a reply to message #568470] Fri, 12 October 2012 02:03 Go to previous messageGo to next message
vikashkrburnwal@gmail.com
Messages: 61
Registered: October 2012
Location: Bangalore
Member
Thanks sir i got it.
Smile
Re: How to insert value in column which has date datatype? [message #568472 is a reply to message #568471] Fri, 12 October 2012 02:12 Go to previous messageGo to next message
Michel Cadot
Messages: 57612
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Now do you understand what is in the documentation?

Regards
Michel
Re: How to insert value in column which has date datatype? [message #568502 is a reply to message #568470] Fri, 12 October 2012 08:21 Go to previous messageGo to next message
Solomon Yakobson
Messages: 1794
Registered: January 2010
Senior Member
muralikri wrote on Fri, 12 October 2012 02:57
Hey Try like...


Discover date literals:

update emp set modified_on = DATE '2012-10-15' where empno=7566 


SY.
Re: How to insert value in column which has date datatype? [message #568503 is a reply to message #568502] Fri, 12 October 2012 08:26 Go to previous message
Michel Cadot
Messages: 57612
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Far above OP's skills.

Regards
Michel
Previous Topic: start previous col with 0
Next Topic: sending email or not
Goto Forum:
  


Current Time: Sat Apr 19 07:58:06 CDT 2014

Total time taken to generate the page: 0.10512 seconds