Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Make a field have Default Values? (Table Creation)
Brian,
The syntax should be;
parts number(14,2) default := 0.
Oracle's number(14,2) only states that the maximum number of decimals places is 2, but Oracle won't store this information for an integer.
To feedback a 2 digit decimal, use a format mask such as
to_char(parts,'9999999.99');
Andrew
Brian Lavender wrote:
> I am trying to create a table that has a default value in the event the user
> does not enter a value. I tried this statement for creating the table, but it
> does not work:
>
> create table test (
> id number not null ,
> parts number(14,2) default = 0.00
> )
>
> How do I make it so parts gets a value of 0.00 if the user does not insert a
> value?
>
> brian
> --
> Brian E. Lavender
> US Army Corps of Engineers -- Programmer / Systems Analyst
> Sacramento, CA (916) 557-6623
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Thu Apr 22 1999 - 19:39:57 CDT
![]() |
![]() |