Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to set default date format?

6795Sep 26 2001 — edited Jun 22 2005
How do i set a default date format when i start a database instance? [DBMS: Oracle 9i on RedHat Linux 7.1]

For ex:
- I have a database called workDb.
- I already have a program written which
inserts a record into a database table.
- That record has a date value too which
i want to insert into the Oracle 9i DB
in yyyy-mm-dd format.
- I do not want to change the SQL statement
in my program
- BUT when i start workDb instance is there
a way to tell that any date field should
be inserted in yyyy-mm-dd format only.
[Like, i can change the date format from
database to database]

is this really possible?

NOTE: I do not want to change the sql
statement in my progam

FYI: The SQL statement in my program is this
String mydate="2001-09-25";
String sql = "insert into myprofile(activationDate) values('"+mydate+"')";

Please help me on this.

--
Thanks a lot
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 20 2005
Added on Sep 26 2001
21 comments
3,672 views