Home » SQL & PL/SQL » SQL & PL/SQL » Updating Specified Fields
Updating Specified Fields [message #629131] Wed, 03 December 2014 11:14 Go to next message
Rajesh Reddy
Messages: 6
Registered: November 2014
Location: Hyderabad
Junior Member
Hi everyone,

Actually i had a table of which it consistes of a date column datatype
ex:-
empid name job hiredate sal
----- ---- --- -------- ----
100 james se 10/10/14 5000
101 jim agm 01/12/14 600

Unexpectdly in hiredate column i need to update years positions with months values.
I gave hiredate in (dd/mm/yy).I need to update yy place with mm and viceversa.

Can anyone help in this using Sql.
Re: Updating Specified Fields [message #629133 is a reply to message #629131] Wed, 03 December 2014 11:18 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
SELECT TO_CHAR(HIREDATE,'DD/YY/MM') from emp;
Re: Updating Specified Fields [message #629137 is a reply to message #629131] Wed, 03 December 2014 12:33 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
Do not confuse STOREING data with DISPLAYING data

see: - But I want to store my date as ...
Re: Updating Specified Fields [message #629138 is a reply to message #629131] Wed, 03 December 2014 12:33 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

As already told to you:

Lalit Kumar B wrote on Fri, 28 November 2014 16:15
Hello Rajesh,

Welcome to the forum. Good to see you want tk help OP, however, it would be nice if you follow posting guidelines. You need to use code tags, and it would be good if you add an explanation about your suggestion.


Your answer:

Rajesh Reddy wrote on Fri, 28 November 2014 17:48
Thanks Lalit,
I adhere to it.


So?

And:

Michel Cadot wrote on Sat, 29 November 2014 07:30
...
Forgot to mention: it has already been told to you to format your posts.
So read again How to use [code] tags and make your code easier to read.


cookiemonster wrote on Tue, 02 December 2014 15:53
You've been asked more than once to read and follow How to use [code] tags and make your code easier to read?. It's past time you did so.


Lalit Kumar B wrote on Tue, 02 December 2014 16:11
@Rajesh,

http://www.orafaq.com/forum/mv/msg/195459/628818/#msg_628818

Doesn't look like you are doing what you said!


Not following the moderators calls to order is not a good idea.
So, Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Also always post your Oracle version, with 4 decimals.
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.



[Updated on: Wed, 03 December 2014 12:34]

Report message to a moderator

Re: Updating Specified Fields [message #629142 is a reply to message #629138] Wed, 03 December 2014 14:49 Go to previous messageGo to next message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
Date columns store the date and time in a special internal format. You can display it anyway you want as Blackswan illustrated
Re: Updating Specified Fields [message #629182 is a reply to message #629131] Thu, 04 December 2014 03:42 Go to previous message
gazzag
Messages: 1118
Registered: November 2010
Location: Bedwas, UK
Senior Member
TO_CHAR
Previous Topic: ORA-01010 Invalid OCI Operation during SCHEDULER job procedure that selects from db link
Next Topic: ORA-06553: PLS-306: wrong number or types of arguments in call to 'ROWID_BLOCK_NUMBER'
Goto Forum:
  


Current Time: Fri Apr 26 03:12:13 CDT 2024