Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old April 30th, 2004, 07:58 PM
nick nak nick nak is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 3 nick nak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Automatically generating new dates

I have a problem. I have a 'Meeting' table whereby people attend all types of diferent 'Meetings'. Several 'Meetings' run a week but a particular 'Meeting' will not run twice on the same day. I have given the 'Meetings' unique idenfiers by using a composite primary key consisting of the 'MEETING_NAME' and the 'MEETING_DATE' it is to be held e.g. Gamblers Anonymous, 26/APR/2004. The problem is i wish to have 4 weeks worth of 'Meetings' in the database, and at the end or start of each month i would like the system to create new Meetings using the same information except that the dates are for the next four weeks. I will provide some sample data below so you have a better understanding. In the sample data below i have only showed one week which starts on the Monday the 26th of April and finishes on Sunday the 2nd of May. In reality there are four weeks worth of Meetings. As you can see the only data that will change below is the date as the meetings week by week have the same name, day it is held on, time and duration.

MEETING TABLE

MEETING_NAME MEETING_DATE DAY TIME DURATION

Gamblers Anonymous 26/APR/2004 MONDAY 6pm 2 HOURS
Alcoholic Anonymous 26/APR/2004 MONDAY 8pm 2 HOURS
Smokers Anonymous 27/APR/2004 TUESDAY 6pm 2 HOURS
Overeaters Anonymous 27/APR/2004 TUESDAY 8pm 2 HOURS
Cocaine Anonymous 28/APR/2004 WEDNESDAY 6pm 2 HOURS
Marijuana Anonymous 29/APR/2004 THURSDAY 4pm 2 HOURS
Marijuana Anonymous 30/APR/2004 FRIDAY 5pm 2 HOURS
Sexaholics Anonymous 30/APR/2004 FRIDAY 8pm 2 HOURS
Parents Anonymous 01/MAY/2004 SATURDAY 5pm 2 HOURS
Emotions Anonymous 02/MAY/2004 SUNDAY 4pm 2 HOURS

I believe that the system date will need to be used in order to perform this task, but im not sure. If anyone knows how i can do this then please replie back.

Reply With Quote
  #2  
Old May 2nd, 2004, 08:58 AM
jimbag8 jimbag8 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 28 jimbag8 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
automated process

Why would you only want to have 4 weeks of meetings in the system? Why not keep them all and flag them as active or inactive. At that point all you wouldhave to do is write a cron/scheduled task (Unix/Wind*ws) that would kick off once per month to add copies of the existing jobs and updated the old to "I" for inactive.

As far as the structure, yes I would use sysdate + some number of days for every date field.

hopefully I'm not too far out in left field with this answer.

~jimbag8

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Automatically generating new dates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway