Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

Oracle gurus: Percent

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » The DU Lounge Donate to DU
 
Hawkeye-X Donating Member (1000+ posts) Send PM | Profile | Ignore Thu Nov-13-03 06:28 PM
Original message
Oracle gurus: Percent
I need to add a percent check on a alter table query

something like this:

ALTER TABLE REP
ADD CHECK (RATE < 0.15D)

How do I do this?
Printer Friendly | Permalink |  | Top
Hawkeye-X Donating Member (1000+ posts) Send PM | Profile | Ignore Thu Nov-13-03 06:40 PM
Response to Original message
1. kick
HELP!
Printer Friendly | Permalink |  | Top
 
Bozola Donating Member (992 posts) Send PM | Profile | Ignore Thu Nov-13-03 06:58 PM
Response to Original message
2. yer close....
drop table poopy;

create table poopy(
id int not null,
pct decimal(10,4) not null,
oth decimal(10,4) not null,
);


ALTER TABLE poopy
ADD CONSTRAINT PctCheck CHECK (pct >= 0 and pct < 1.0),
CONSTRAINT Othcheck CHECK (oth < 0.15);

--hits constraint
insert into poopy(id,pct,oth) values (1,1,0.5);

--okie dokie
insert into poopy(id,pct,oth) values (1,.99, 0.14);

select * from poopy;
Printer Friendly | Permalink |  | Top
 
DU AdBot (1000+ posts) Click to send private message to this author Click to view 
this author's profile Click to add 
this author to your buddy list Click to add 
this author to your Ignore list Sat May 04th 2024, 05:17 AM
Response to Original message
Advertisements [?]
 Top

Home » Discuss » The DU Lounge Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC