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!

date format in create table statement

Jana KralovaApr 21 2011 — edited Apr 21 2011
Hello,

I would like to know if it possible to CREATE TABLE with formated date;

create table months
(id number,
(month_col to_char( month_col,'MM'));
so when I insert
insert into months values (1,sysdate); 
And query

select *from months;

I would get
id     months_col
-----------------------------
1           04
I know this could easily be done by cerating a view on a table, but I was wondering if this was possible to implement directly into table.
I browesed through the documentation, but did not find any datatype that would support this.

Thank you for replies.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 19 2011
Added on Apr 21 2011
4 comments
2,654 views