How does this Oracle job works

Hi everyone!
One of my buddy has created t his job:
sys.dbms_job.submit(jobno, 'SendEmail();', (sysdate + 2/86400), null);
Its sending the emails very frequently.
How should this job work? Please guide me.
Thanks in advance.
Nith

Here's a demo of an application code / user submitting a job frequently. Each time the JOB_ID changes but the job "seems" to be present in USER_JOBS. It is a new job each time ! The DBMS_JOB.SUBMIT call does not specify an INTERVAL, so a submitted job is executed only once and exits from the queue. The next submission seems to be the same job, but is actually a new one --- which you can identify because JOB_ID changes.
10:09:21 SQL> create or replace procedure send_email
10:09:21   2  as
10:09:21   3  begin
10:09:21   4   -- do some processing, send an email
10:09:21   5   null;
10:09:21   6  end;
10:09:21   7  /
Procedure created.
10:09:21 SQL>
10:09:21 SQL> variable jno number;
10:09:21 SQL>
10:09:21 SQL> exec dbms_job.submit(:jno,'send_email();',(sysdate+5/86400));
PL/SQL procedure successfully completed.
10:09:21 SQL> commit;
Commit complete.
10:09:21 SQL>
10:09:21 SQL> select job, what, next_date, next_sec from user_jobs;
       JOB WHAT                                          NEXT_DATE NEXT_SEC
       146 send_email();                                 25-MAY-11 10:09:26
10:09:21 SQL>
10:09:21 SQL> exec dbms_lock.sleep(10);
PL/SQL procedure successfully completed.
10:09:31 SQL>
10:09:31 SQL> exec dbms_job.submit(:jno,'send_email();',(sysdate+5/86400));
PL/SQL procedure successfully completed.
10:09:31 SQL> commit;
Commit complete.
10:09:31 SQL>
10:09:31 SQL> select job, what, next_date, next_sec from user_jobs;
       JOB WHAT                                          NEXT_DATE NEXT_SEC
       147 send_email();                                 25-MAY-11 10:09:36
10:09:31 SQL>
10:09:31 SQL> exec dbms_lock.sleep(10);
PL/SQL procedure successfully completed.
10:09:41 SQL>
10:09:41 SQL> exec dbms_job.submit(:jno,'send_email();',(sysdate+5/86400));
PL/SQL procedure successfully completed.
10:09:41 SQL> commit;
Commit complete.
10:09:41 SQL>
10:09:41 SQL> select job, what, next_date, next_sec from user_jobs;
       JOB WHAT                                          NEXT_DATE NEXT_SEC
       148 send_email();                                 25-MAY-11 10:09:46
10:09:41 SQL>
10:09:41 SQL> exec dbms_lock.sleep(10);
PL/SQL procedure successfully completed.
10:09:51 SQL>
10:09:51 SQL> exec dbms_job.submit(:jno,'send_email();',(sysdate+5/86400));
PL/SQL procedure successfully completed.
10:09:51 SQL> commit;
Commit complete.
10:09:51 SQL>
10:09:51 SQL> select job, what, next_date, next_sec from user_jobs;
       JOB WHAT                                          NEXT_DATE NEXT_SEC
       149 send_email();                                 25-MAY-11 10:09:56
10:09:51 SQL>
10:09:51 SQL> exec dbms_lock.sleep(10);
PL/SQL procedure successfully completed.
10:10:01 SQL>
10:10:01 SQL> -- Now, since I have not resubmitted the job, it doesn't appear any more !
10:10:01 SQL> select job, what, next_date, next_sec from user_jobs;
no rows selected
10:10:01 SQL>Notice how the job doesn't appear at the last query ? Because the application / user did not resubmit it after the previous submission and query. So it has "disappeared".
Hemant K Chitale
Edited by: Hemant K Chitale on May 25, 2011 2:23 PM
Edited by: Hemant K Chitale on May 25, 2011 2:25 PM

Similar Messages

  • How does this IMPORT statement works

    can any one tell me how does this statement will work..
    I am wokring on Solution manager system , where in there is a function module SSF_FIELD_LIST
    to which system passes form name.
      import fields to fieldlist
             from database stxfcontr(sf) id l_fullname.
    stxfcontr is a table which contains value of in  a diff
    Regards,
    mayank

    It will import data object stored in memory under named fields to your custom data object fieldlist .
    The table which it is stored is name stxfcontr under RELID (memory area) SF .
    Cluster key (key of the entry) in that table is behind var l_fullname
    Anyhow I think [this link|http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3bf8358411d1829f0000e829fbfe/frameset.htm] is more that any explanation. Once you study it, you will understand the above.
    Regards
    Marcin

  • How does this SAVE View works in WAD ?

    Experts,  Before putting this question, i did search for this isssue but couldnt find the correct answer.
    when i run the query in portal i get the correct report. but when i right click on any of the charastractis, i could see the drop down list with some options. in this list of options, there is one entry "Save View"
    I tried saving it, with technical name and desc. but i couldnt find it anywhere.
    does anyone has idea ? how this save view works in Portal ?
    thanx

    Hi, plz. find my answers inline.
    My question is how can we make use of this View. So, what is the importance of VIEW ? How users get benefited ?
    >> If you have scenarios wherein users would want to carry out their own analysis & save for future reference/records, then query views prove to be beneficial. Else creating individual queries to suit user preferences is cumbersome & time consuming.
    I was researching on SDN, and found that if i save it As a VIEW. then if we change the query. the saved view remains unchanged. is that right ? But, what if i remove some characteristics from the query ? Does it remove from the VIEW too ?? Or, Its just, if we make some changes to Key figure structure. It wont make any impact on view.
    >>  You execute a query with its initial view, change the initial view by navigating in the data, and save this new navigational state as a query view. If you later change the initial view of the query in the BEx Query Designer, this change has no effect on the query view previously saved. The query view already exists as an independent object.
    Please let me know. if you find some documentation please post a link, i am happy to read that.
    >> http://help.sap.com/saphelp_nw70/helpdata/en/46/0294bc82f37041e10000000a155369/content.htm
    That if you are using WAD and save as view, you can open using BEx analyzer or the other way around ?
    >> You can create and open a query view from BEx Analyzer or Web / WAD, as long as you have the option to.
    --Priya

  • How does this Linked List work?

    Hi.
    I wonder how this linked list work
    import java.util.Scanner;
    public class LinkedList {
        public static void main(String[] args) {
            Scanner in = new Scanner(System.in);
            Elem front = null;    // First element of list.
            Elem back  = null;    // Last element of list.
            while (in.hasNext()) {
                String word = in.next();
                Elem e = new Elem();     // Create a new list element.
                e.data = word;           // Set the data field.
                if (front == null) {
                    front = e;            // Back element will be set below.
                } else {
                    back.next = e;       // Link last elem to new element.
                back = e;           
            System.out.println("*** Print words in order of entry");
            Elem curr = front;
            while (curr != null) {
                System.out.println(curr.data);
                curr = curr.next;
    class Elem {
        public Elem next;    // Link to next element in the list.
        public String data;  // Reference to the data.
    }Does anyone know how this allocates memory?
    I feel strange because it's just front = e
    and back = e
    but it never says anything like front.next = back or something..
    Can anyone help me on this?

    Does anyone know how this allocates memory?Memory is allocated on this line:            Elem e = new Elem();     // Create a new list element.
    I feel strange because it's just front = e
    and back = e
    but it never says anything like front.next = back or something..Well, it doesn't need to. Setting .next is taken care of after the initial element is added. It never explicitly says front.next = back because front.next is set when the second element is added. It's set implicitly, on this line:                back.next = e;       // Link last elem to new element.It's implicit in that at that point front and back point to the same element.

  • How does this configurator module work?

    Hello,
    I'm a PHP programmer that has some work that I need to do for
    a client.
    He owns an online tshirt store and wants to develop a
    configurator similar to the own seen here:
    http://propercloth.com/custom-mens-shirts.php#
    You can see as you select fabrics & components the image
    of the shirt on the left updates with the texturised version. My
    client already has a database of his materials ready to plug into
    something like this. I'm quite unfamilar with flash as I mainly do
    backend PHP and I was wondering if someone here might know how this
    flash module works or has some experience coding one so I can get
    my head around how this thing works.
    What is required to create or how would I go about creating:
    1. The base model tshirt
    2. Individual components such as pockets that can be
    shown/hidden
    3. The texturisation engine
    4. Populating the base model with a selected material
    (colour)
    Any advice much appreciated!
    Marv.

    There is no flash on that page. All of that animation is done
    using Javascript. It looks like its using elements from the jquery
    library. You can find out more about it at
    http://www.jquery.com. There are
    other libraries with similar functionality. I prefer mootools:
    http://mootools.net/ .

  • How does this parameter passing work?

    Got these 4 lines of tsql from a trace of an SSIS package. How does it end up passing 127,475,@p4 to ifs_BuildGenericQuery?
    declare @p4 nvarchar(max)
    set @p4=NULL
    exec sp_executesql N'exec ifs_BuildGenericQuery @P1, 475, @P2 out',N'@P1 bigint,@P2 nvarchar(max) OUTPUT',127,@p4 output
    select @p4
    When I debug the four lines, it ends up passing 127,475,@p4 to ifs_BuildGenericQuery.
    CREATE Proc [dbo].[ifs_BuildGenericQuery]
    (@RECID int, -- 127
    @PADFIELDS int, -- 475
    @SQLQUERY nVarchar(max) output, -- @p4
    @DIAGNOSTICS int = 0)
    As
    BEGIN
    END

    Break it up into parts so you can "see" it. 
    N'exec ifs_BuildGenericQuery @P1, 475, @P2 out'
    N'@P1 bigint,@P2 nvarchar(max) OUTPUT',
    127,
    @p4 output
    The first argument is a string that contains the query to be executed.  In it, @P1 and @p2 are variables whose values will be "derived" by sp_executesql from the other arguments. The next argument is the definition of any variables referenced
    in the query.  Anything after that are the values that are passed into those variables in the query.  In this case, 127 (a bigint) replaces @p1.  @p4 (which is declared and initialized in the preceding lines of the batch) replaces @p2. The value
    of 475 is hardcoded - which should be obvious.

  • How does this JSF mapping work

    an example I'm looking at has a forward " <jsp:forward page="/pages/inputname.jsf" /> " in index.jsp. How does faces map this forward request to inputname.jsp
    The only mapping in the web.xml is
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    Thanks ..

    RaymondDeCampo wrote:
    JFrain2004 wrote:
    Yes, I've seen that in the web.xml. Is it under the hood that JSF looks for a file called inputname.jsp when it gets a request for inputname.jsf?Yes; the default ViewHandler implementation does this. Alternate ViewHandlers, e.g. the FaceletsViewHandler, perform different mappings.Indeed. If you want to know how they did it in Mojarra, download the sources and check the com.sun.faces.application.ViewHandlerImpl class.

  • How does this new Firewall work?

    I've upgraded from Tiger to Leopard, but I just don't understand the new firewall.
    Does anyone know what the correct settings should be? Is it wise to 'allow all connections'? Does this mean the firewall is off?
    Really confused by this, I wish they left the firewall alone, the Tiger version was much easier to configure.

    I think I'll wait until 10.5.1 and see what Apple do about this ridiculous firewall.
    BRING BACK THE TIGER FIREWALL!!!

  • How does this radio button work?

    The attached code is from LabVIEW7.1 example. I just can't figure out how does the 'green' button connect with the 'case green'? Do I need to change the properties of the radio button?
    Attachments:
    Radio Buttons Control.vi ‏32 KB

    Just make the radio control a bit larger and drop in another boolean control (pick ANY!) from the palette. Repeat as needed.
    The radio button control automatically ensure that only the last clicked boolean is true. (see attached, LabVIEW 7.1)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    RadioButtonsControl2.vi ‏43 KB

  • How does this LIKE operator work ?

    Values JOHN and KEITH have spaces in the string.
    create table string_test ( test_str varchar2(15));
    insert into string_test values ('JO HN');
    insert into string_test values ('JOHN');
    insert into string_test values ('RAM');
    insert into string_test values ('KEITH ');
    SQL> select * from string_test;
    TEST_STR
    JO HN
    JOHN
    RAM
    KEITHFrom OTN , i found the query to find all string values which has a white space in it.
    select * from string_test where test_str like '%' || chr(32) || '%';But, i don't understand how this works. Won't the percent sign in single quotes ('%') be considered a literal ?

    GarryB wrote:
    Values JOHN and KEITH have spaces in the string.
    create table string_test ( test_str varchar2(15));
    insert into string_test values ('JO HN');
    insert into string_test values ('JOHN');
    insert into string_test values ('RAM');
    insert into string_test values ('KEITH ');
    SQL> select * from string_test;
    TEST_STR
    JO HN
    JOHN
    RAM
    KEITHFrom OTN , i found the query to find all string values which has a white space in it.
    select * from string_test where test_str like '%' || chr(32) || '%';But, i don't understand how this works. Won't the percent sign in single quotes ('%') be considered a literal ?No, because the "%" sign has special meaning to the LIKE operator. It's a wildcard meaning any characters.

  • How does this LINQ query work with Option Infer Off?

    How should value and filtered be declared?  It doesn't work when I turn Option Infer Off.  Originally, it worked with Option Infer On. There was no Dim statement on the first line, but the Dim keyword was placed before the
    filtered = line.  As soon as I turned Option Infer Off, all sorts of errors showed up.  How should the code be adjusted?  (Option Strict is On.)
    Dim element, value, filtered As Integer
    Dim values() As Integer = {2, 9, 5, 0, 3, 7, 1, 4, 8, 6}
    filtered =
    From value In values
    Where (value > 4)
    Select value
    For Each element In filtered
    Console.Write(element & " ")
    Next
    Solitaire

    Hi Solitaire,
    the Option Infer Off version would be:
    Option Strict On
    Option Infer Off
    Imports System
    Imports System.Collections.Generic
    Imports System.Linq
    Public Class Class1
    Public Shared Sub LinqWithNoInfer()
    Dim values() As Integer = {2, 9, 5, 0, 3, 7, 1, 4, 8, 6}
    ' compiled to
    ' filtered = values.Where(Function(value As Integer) value > 4).Select(Function(value As Integer) value)
    value)
    Dim filtered As IEnumerable(Of Integer) =
    From value In values
    Where (value > 4)
    Select value
    For Each element As Integer In filtered
    Console.Write(element & " ")
    Next
    End Sub
    End Class
    The type for filtered is determined by the Select statement, that is
    Enumerable.Select, and will return an
    IEnumerable(Of T) and T is an Integer here.
    Option Infer looks for the return value of Select and will give the same result.
    Note: For Lambda Expressions Option Infer Off is ignored and the type is inferred - both are valid:
    filtered = values.Where(Function(value) value > 4).Select(Function(value) value)
    filtered = values.Where(Function(value As Integer) value > 4).Select(Function(value As Integer) value)
    Regards, Elmar

  • How does this crappy program work

    How do I cut & paste onto another word document from a converted pdf file?

    You sure know how to win friends and get help. Well, good luck with that!

  • How does the verizon wifi work? Do you pay monthly?

    I want to buy the new iPad with retina display as a gift, but how does this verizon wifi work? Do you pay monthly or have to call Verizon?

    You're post is a little confusing. WiFi signals are not done through Verizon unless you are talking about using a Verizon MiFi hotspot such as this http://www.verizonwireless.com/b2c/store/controller?&item=phoneFirst&action=view PhoneOverviewByDevice&deviceCategoryId=13&cmp=KNC-58700000028195084&zipRdr=y.
    4G wireless cell signals are done through Verizon. WiFi comes from places such as your home wireless network, or WiFi hotspots at places like Starbucks, restaurants, pubs, etc.
    If you are asking about Verizon's wireless cell service, it's $20 a month for 1 gig of data, $30 a month for 2 gigs of data, or $50 a month for 5 gigs of data.

  • My iPhone was stolen and I have contacted the police who are using the meid number to locate.  How does this work and what are my chances of getting the phone back?

    My iPhone was stolen.  I used Find My iPhone app to lock it and display a message.  The phone has not connected to the internet to locate it.  I contacted the police and they have taken my meid number.  How does this work and what are my chances of getting the phone back?  Are there other ways the theif can use it.  I was told once they put in a new sim card and use it, whatever software the police have, it will show up.

    Honestly? In the US (I can't speak to other countries, though I doubt it works much differently in a lot of the world) The police took your report and filed it either in their computers or, on paper. They will now not think of this again. The only time it will cross anyones mind is if, in the course of entering information into evidence about items recovered or seized at a crime scene, the serial number of an iPhone that was found/seized happens to match yours, in which case you will be contacted.
    The police in the US can and will do nothing to 'blok' the phone and it's not worth their time to try and locate it unless you know for a fact that it was stolen by a big time drug lord, master criminal, or some other such prime target and they can get a court order to track the location of the phone in order to locate this individual for your own purposes.  If they do that, they'll probably keep him under surveilance for a year or so before they act.
    Basically, the police don't care about your phone. If they find it, they will give it back to you. They are not, however, going to go looking for it. They have better things to do.
    I'm sorry, but that's the way it is.

  • Was told a USB device would create a PDF automatically from the data contained within when plugged into my USB port. Doesn't seem to work. How does this work and how can I fix the device I received?

    Acrobat is not on the USB device - only Adobe Reader needed on the PC. How does this work? How can I fix this device if at all?

    You need to ask the people who sold it to you. Doesn't sound like it has anything to do with Reader.
    However, you should be wary of devices that automatically try to open files when plugged in. They can also infect your computers with all kinds of viruses or malware.

Maybe you are looking for

  • Remove songs from iPhone but not from playlist in 7.1

    I use iTunes Match and I recently updated my iPhone 5 to iOS 7.1.  Before 7.1, when in the music app and I wanted to delete a song from my phone i was able to swipe from right to left and delete the song from my phone but it would still remain in the

  • YTD calculation at product level

    Hi Friends, Am not sure if this is the right forum to post a BW question. I have a requirement to calculate YTD, however the way this has to be calculated is a different. We have multiple products, but for each product we have different periods(start

  • Error while creating vendor

    Hi, I am creating a new vendor using VMD_EI_API-maintain. However on rare occassions i get an error  "LIFNR: Invalid value (foreign key check failed) .Entry 000000XXXX does not exist in LFA1 (check entry) ". Please note that the vendor number mention

  • Rubbish code in text file

    hi, i downloaded a txt file from 3rd party software and upload to sap. all country are ok except 1 country. on first line, there is a character at the begining of the line : 锘?20:070511 it should actually be :20:070511. this character only can be see

  • IPod Video Volume Bug

    Hello everybody I have a problem with the volume for music videos. if I play them and move the volume up to maximum then the volume is much lower, if I do the same with audio files. funny is, when is choose maximum volume and stop the video and play