Solved

PERCENT IN SQL ORACLE

Posted on 2009-07-08
1
1,934 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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

11 Experts available now in Live!

Get 1:1 Help Now