Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Design question: EFFECTIVE_?_DATE in a RATE table...
Chris,
Yes, I've done it with a single date column as you specified in the second approach.
The following bit of code may be helpful:
declare
v_claim_date date := to_date('02/01/2002','mm/dd/yyyy'); v_rate_code rate.rate_code%type := 'ABC'; v_rate_date date;
select min(effective_date) into v_rate_date from rate where rate_code = v_rate_code and effective_date between v_claim_date andto_date('12/31/9999','mm/dd/yyyy');
end;
/
Returning no row indicates that the claim is not covered.
This SQL is probably not optimal, but illustrates the idea.
It's much easier for users and developers to juggle a single date per record than try to ensure the the start_dates and end_dates are all in sync.
Jared
"Grabowy, Chris" <cgrabowy_at_fcg.com>
Sent by: root_at_fatcity.com
04/22/2002 04:54 PM
Please respond to ORACLE-L
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> cc: Subject: Design question: EFFECTIVE_?_DATE in a RATE table...
A design question, my RATE table looks something like this....
SQL> desc rate
Name
Null? Type
those are the PK fields...and the SQL to query the table is easy. I am trying to determine if I can "tighten up" the table, like this...
SQL> desc rate
Name
Null? Type
Has anyone else taken this approach?
Sorry for these design questions, I am just being very anal about every table, PK column and index, before we dive into development and everything becomes "hard coded".
TIA!!!!
Chris
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Grabowy, Chris
INET: cgrabowy_at_fcg.com
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author:
INET: Jared.Still_at_radisys.com
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Mon Apr 22 2002 - 20:38:18 CDT
![]() |
![]() |