Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: will this date formatting work?
[Oops, forgot to change the subject while forging the headers on my last
post. Cancelled it. Reposting. Sorry for the confusion if you saw it
before it was cancelled.]
Greetings:
I posted a question a month ago about using a particular date format to get data into and out of an Oracle database.
While I appreciate everyone's sincere efforts to help, y'all seemed to reply with tips on how to do things "the Oracle way" rather than answering the question. For example, replies digressed into the concepts of how the data is stored, just as had happend to all prior threads on this topic I saw in the newsgroup archives. Others suggested using different formats. Oh well...
So, I finally got around to downloading a development version of 9i and running a test. I figured it's a good idea to post a followup for the benefit of those in the group now and those searching the archives in the future.
My question was, in essence, "will the following work?"
ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD';
CREATE TABLE STP_SystemDate (
SystemDate date default '0001-01-01' NOT NULL
);
INSERT INTO STP_SystemDate VALUES (DEFAULT);
INSERT INTO STP_SystemDate VALUES ('2003-10-30');
SELECT SystemDate FROM STP_SystemDate;
The output from the above is...
SYSTEMDATE
So, the answer I was looking for is, "yes."
Again, thank you for your tips,
--Dan
-- FREE scripts that make web and database programming easier http://www.analysisandsolutions.com/software/ T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409Received on Thu Nov 27 2003 - 17:58:10 CST