Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PERCENT IN SQL ORACLE

Posted on 2009-07-08
1
Medium Priority
?
1,967 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 60

Accepted Solution

by:
Kevin Cross earned 2000 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

Technology Partners: 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

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 …
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

604 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