Solved

PERCENT IN SQL ORACLE

Posted on 2009-07-08
1
1,945 Views
Last Modified: 2012-06-27
CAN I FORMAT A PERCENTAGE IN ORACLE?
I WOULD LIKE OPTION_PERCENTAGE TO BE ONLY DECIMAL PERCENTAGE.

I AM GETTING ERROR WITH NUMBER(0,2)

ANY IDEA?
THANKS!!
CREATE TABLE DRAWOP
  ( OPTION_NUMBER NUMBER(5,0)   
  , OPTION_TYPE VARCHAR2(1)
  , OPTION_DESCRIPTION VARCHAR2(20)
  , OPTION_UNIT_COST NUMBER(5,2)
  , OPTION_UNIT_PRICE NUMBER(5,2)
  , OPTION_PERCENTAGE NUMBER(0,2) 
  , CONSTRAINT OP_TYPE CHECK (OPTION_TYPE IN ('%', '$')));

Open in new window

0
Comment
Question by:ba_trainer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 59

Accepted Solution

by:
Kevin Cross earned 500 total points
ID: 24807139
Think you WANT NUMBER(2, 2) for the format and then you can put a constraint that value is >= 0 and <= 1.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question