[NTLUG:Discuss] OT Oracle date question on UNIX with OCI

Eric Schnoebelen eric at cirr.com
Thu Dec 13 12:28:19 CST 2007


Fred James writes:
- All
- UNIX is the only forgiving factor - otherwise this is OT, but I should 
- appreciate any help you may be able to offer
- 
- select date ..... and then pass it to an external procedure (OCI) ... 
- but in the end I need to print the date and time as "mm/dd/yyyy 
- HH:MM:SS" ... right now all I can get is "DD-MON-YY"

- Database: Oracle 8.0.4.1

wow, a moderately antique version of oracle..

are you returning a date type from your external proceedure?

If so, use the SQL function to_char() to format it in the
fashion you wish (assuming this is in PL/SQL or SQL.)

The interesting arguments to to_char are:

	to_char(<variable>, <format string>)

eg:
	to_char(<variable>, 'MM/DD/YYYY HH12:MI:SS');

--
Eric Schnoebelen		eric at cirr.com		http://www.cirr.com
	    I used to suffer from multiple personality disorder.
		      However, we're much better now...



More information about the Discuss mailing list