Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Yearly Automatic Table Insertion

Re: Yearly Automatic Table Insertion

From: Mark <simmons_mark_at_yahoo.com>
Date: 22 Mar 2004 15:58:00 -0800
Message-ID: <5366fb41.0403221558.4322d5f2@posting.google.com>


I got a kick out of Ed's reply. :)

You could insert all of the years for the next 20 years all at once. That way you don't have to schedule a job. Change your query so that it selects only the appropriate values...

select year
from dates
where year<=to_number(to_char(sysdate, 'YYYY')) /

Mark Simmons
Sr. Oracle DBA
Sabre-Holdings, Southlake, TX

Ed Stevens <nospam_at_noway.nohow> wrote in message news:<2rem509jgsv7ji8rr4mt5h3f08mjkbgkgu_at_4ax.com>...
> On 19 Mar 2004 09:51:50 -0800, mwagner_at_mail.dot.state.de.us (mw)
> wrote:
>
> >I have a table called years in my database that is used for populating
> >a year dropdown list on various end user web forms. I'm looking for a
> >solution for automatically adding the next year to this table at a
> >specified date, once a year, on a recurring yearly basis (i.e. every
> >December 1st, the next year is automatically added to the years
> >table). The application is a java web application, using
> >CallableStatements to execute plsql packages, functions, etc on the
> >database side. It may be distributed to many clients. I thought of
> >creating stored procedure, then scheduling it thru dbms_job to run
> >once a year. Is there a better solution? What would be the most
> >efficient way to do this?
>
>
> Inserting one row into one table once a year .. . . who cares about
> the most efficient way to do it? You've already spent more time
> writing your question than even the most IN-efficient method will cost
> within your grandchldren's lifetime! ;-)
>
> Use dbms_job.
Received on Mon Mar 22 2004 - 17:58:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US