Solved

PERCENT IN SQL ORACLE

Posted on 2009-07-08
1
1,935 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now