|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Automatically generating new dates |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|