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

Home -> Community -> Mailing Lists -> Oracle-L -> Re:Trigger or ????

Re:Trigger or ????

From: <dgoulet_at_vicr.com>
Date: Tue, 14 May 2002 08:33:29 -0800
Message-ID: <F001.00460201.20020514083329@fatcity.com>


Laura,

    Look at using a DBMS_JOB. They fire whenever you need them to.

Dick Goulet

____________________Reply Separator____________________
Author: "Burton; Laura L." <BurtonL_at_prismplus.com>
Date:       5/14/2002 6:58 AM

I have a need to reset a sequence number at 00:01 everyday. I thought about creating a trigger to check the time, but thought that there might be a better way than checking the time every time a record is being added. I also thought about checking the max date on the table and comparing against the system date. When system date > max then reset the sequence number. I like this logic better and thought of holes with using the time.

The only problem I have is that this seems like a lot of overhead every time I add a record, which will be often. Is a trigger the only method available to me?

Thanks,

Laura

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>Trigger or ????</TITLE>
</HEAD>
<BODY>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">I have a need to reset a sequence number
at 00:0</FONT><FONT SIZE=2 FACE="Arial">1</FONT><FONT SIZE=2 FACE="Arial"> everyday.&nbsp; I thought about creating a trigger to check the time, but thought that there might be a better way than checking the time</FONT> <FONT SIZE=2 FACE="Arial">every time a record is being added.&nbsp; I also thought</FONT> <FONT SIZE=2 FACE="Arial">about</FONT> <FONT SIZE=2 FACE="Arial">checking the max date on the table and comparing against the system date.&nbsp; When</FONT> <FONT SIZE=2 FACE="Arial">system date</FONT> <FONT SIZE=2 FACE="Arial">&gt;</FONT> <FONT SIZE=2 FACE="Arial">max then</FONT> <FONT SIZE=2 FACE="Arial">reset the seque</FONT><FONT SIZE=2 FACE="Arial">nce number.</FONT><FONT SIZE=2 FACE="Arial">&nbsp; I like this logic better and thought of holes with using the time.&nbsp; </FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">The only problem I have is that this
seems like a lot of overhead every</FONT><FONT SIZE=2 FACE="Arial"></FONT> <FONT SIZE=2 FACE="Arial">time I add a record, which will be often.&nbsp;</FONT> <FONT SIZE=2 FACE="Arial">Is a trigger the only method available to me?</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">Thanks,</FONT></P>

<P ALIGN=LEFT>Laura</P>

</BODY>
</HTML>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: dgoulet_at_vicr.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 Tue May 14 2002 - 11:33:29 CDT

Original text of this message

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