Home » SQL & PL/SQL » SQL & PL/SQL » date to char ,char to date (oracle 11g express)
date to char ,char to date [message #572531] Thu, 13 December 2012 00:14 Go to next message
rajeshrajdaan
Messages: 16
Registered: July 2012
Junior Member
Hi
oracle 11 g xe

1) i want to pass date in '12 Dec 2012'(CHARECTER) while calling SP and in side SP i have declared parameter as DATE
so I think it should not create any problem in any condition wether it is passed from oracle client or any other front end?

2) i have date in (date type variable) , please tel me how to convert it into char but it should be in iso formate (i want iso formate ,so that it should not create any problem in any condition.if there is any other solution then please give me).

3) and then please tel me how to convert (date in char- in iso or any good foramt) into (date type variable) (so that it should not create problem and this is why i wanted char date in iso format).

4) if there is any good formate and function to convert (date to char) and (char to date) then please tel me ?

yours sincerely.

[Updated on: Thu, 13 December 2012 00:37]

Report message to a moderator

Re: date to char ,char to date [message #572546 is a reply to message #572531] Thu, 13 December 2012 01:45 Go to previous messageGo to next message
Littlefoot
Messages: 19890
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
For this type of conversions, I use TO_CHAR and TO_DATE functions.
Re: date to char ,char to date [message #572552 is a reply to message #572531] Thu, 13 December 2012 02:15 Go to previous messageGo to next message
Michel Cadot
Messages: 60005
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You know the function, just have a look at Database SQL Reference.

Regards
Michel
Re: date to char ,char to date [message #572570 is a reply to message #572552] Thu, 13 December 2012 05:31 Go to previous messageGo to next message
rajeshrajdaan
Messages: 16
Registered: July 2012
Junior Member
thank u,

I have also asked about format?

and few more question which is reated to bestpractice it is not in documents, documents have all formates and functions also.

yours sincerely.
Re: date to char ,char to date [message #572575 is a reply to message #572570] Thu, 13 December 2012 05:58 Go to previous messageGo to next message
cookiemonster
Messages: 11285
Registered: September 2008
Location: Rainy Manchester
Senior Member
Use the correct format for your input data. The documentation lists all possible formats.
Re: date to char ,char to date [message #572577 is a reply to message #572570] Thu, 13 December 2012 06:04 Go to previous message
Michel Cadot
Messages: 60005
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1/ Format models are described in the documentation you have been pointed to.
2/ The best practices are the ones defined in your site.
Me, I NEVER use month or date names to exchange dates, ALWAYS numbers, people do speak different languages. Only in end user reports you can use names, but names as the end user will read it, not your choice.

Regards
Michel
Previous Topic: accumulator in query
Next Topic: General dbms_job Question
Goto Forum:
  


Current Time: Sat Dec 20 12:46:23 CST 2014

Total time taken to generate the page: 0.07193 seconds