Solved

PERCENT IN SQL ORACLE

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Make query more efficient 1 20
What logic to build in order to get a weekly reminder 9 51
Access 2010 Query Syntax 5 30
Query group by data in SQL Server - cursor? 3 34
'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 …
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

810 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