Launch a procedure every quarter of the Year

Hello:
I need to launch a procedure every first day of a quarter of the year (JAN-01, APR-01, JUL-01 and OCT-01) I know that there is a package, DBMS_JOB, but I have no idea how can I used it, plese some one of yours have an example. Thanks
Angel

USER_EXPORT Procedures
There are two overloaded procedures. The first produces the text of a call to re-create the given job. The second alters instance affinity (8i and after) and preserves the compatibility.
Syntax
DBMS_JOB.USER_EXPORT (
job IN BINARY_INTEGER,
mycall IN OUT VARCHAR2);
DBMS_JOB.USER_EXPORT (
job IN BINARY_INTEGER,
mycall IN OUT VARCHAR2,
myinst IN OUT VARCHAR2);
Parameters
Table 48-10 USER_EXPORT Procedure Parameter
Parameter Description
job Number of the job being run.
mycall Text of a call to re-create the given job.
myinst Text of a call to alter instance affinity.
WHAT Procedure
This procedure changes what an existing job does, and replaces its environment.
Syntax
DBMS_JOB.WHAT (
job IN BINARY_INTEGER,
what IN VARCHAR2);
Parameters
Table 48-11 WHAT Procedure Parameters
Parameter Description
job Number of the job being run.
what PL/SQL procedure to run.
Usage Notes
You must issue a COMMIT statement immediately after the statement.
Some legal values of what (assuming the routines exist) are:
'myproc(''10-JAN-82'', next_date, broken);'
'scott.emppackage.give_raise(''JENKINS'', 30000.00);'
'dbms_job.remove(job);'
Note:1. have start date hardcoaded 1st of next quarter and next date have it as ADD_MONTHS(trunc(sysdate,'q'),3) which is 1st day of every querter

Similar Messages

  • Query for getting data for every quarter for financial year

    Hi,
    My problem is I need to get the data for every quarter for financial year and also I need data for every week for financial year.
    For example for financial year 2012-13, Apr2012 to Jun2012 would be Q1, Jul2012 to Sep2012 would be Q2 and so on. Total 8quarters should come upto Apr2013.
    In the same way  1st apr 2012 to 7th apr 2012 would be week1, 8th apr to 15th apr would be week2 and son on. How to write a query for this scenario in oracle. Can anybody help me on this. very urgent..
    Thanks in advance.

    lakmesri wrote:
    Hi,
    My problem is I need to get the data for every quarter for financial year and also I need data for every week for financial year.
    For example for financial year 2012-13, Apr2012 to Jun2012 would be Q1, Jul2012 to Sep2012 would be Q2 and so on. Total 8quarters should come upto Apr2013.
    In the same way  1st apr 2012 to 7th apr 2012 would be week1, 8th apr to 15th apr would be week2 and son on. How to write a query for this scenario in oracle. Can anybody help me on this. very urgent..
    Thanks in advance.
    How can you get 8 quarters within a year ? I'b be concerned here.
    lakmesri wrote:
    Hi,
    In the same way  1st apr 2012 to 7th apr 2012 would be week1, 8th apr to 15th apr would be week2 and son on. How to write a query for this scenario in oracle. Can anybody help me on this. very urgent..
    Thanks in advance.
    First, that question is really not clearly asked. Second how could it be urgent ? You even did not tell us your Oracle version, did not show any tables descr, output sample nor any effort on your side to work on.
    Nicolas.

  • Quarter of the Year

    Can anybody tell me how to get quarter of the year based on a given date.
    Thanx
    null

    Try:
    select to_char(sysdate,'q') from dual
    Steve

  • Parsing quartes of the year: '3/2008', '1/2010', etc.

    I have a column which contains strings representing quarters of the year, e.g. '3/2008', '1/2010', etc.
    What would be your preferred method to convert these strings to "quarter ordinals", e.g. '3/2008' -> 2008*4+3-1 = 8034, '1/2010' -> 2010*4+1-1 = 8040.
    Thanks!

    user10936714 wrote:
    I need to compare if one quarter is before/after another, so that will work for me ... until the year 10000 :-)In that case you should probably convert the string to a DATE and then do the comparison.
    SQL> WITH t_data AS
      2  (
      3          SELECT '3/2008' as qtr_string FROM DUAL UNION ALL
      4          SELECT '1/2010' as qtr_string FROM DUAL
      5  )
      6  SELECT ADD_MONTHS(TRUNC(TO_DATE(SUBSTR(qtr_string,3,4),'YYYY'),'YEAR'),(TO_NUMBER(SUBSTR(qtr_string,1,1)) - 1)*3) AS quarter
      7  FROM   t_data
      8  ;
    QUARTER
    07/01/2008 00:00:00
    01/01/2010 00:00:00

  • Generate yearmonth for every month of the year

    Hi,
    I need to generate all the dates in the format of yyyymm starting with the last month.
    I mean something like below :
    rownum            yearmonth
    1                       201204
    2                       201203
    3                       201202
    4                       201201
    5                       201112
    ...I know we need to make of pseudo column LEVEL, but cant seem to make it work. Please advise.
    Thanks
    Billu

    Thanks for responding.
    marcusrangel -- I need to use the list of dates from the query for every cutoff that we have for comparision.
    stew -- your query worked just fine.
    Thanks

  • Need function to find 1st friday on every quarter

    Hi,
    need a function or a query to find the 1st friday on every quarter of the current year, any help is appreciated.
    Thank You

    Hi,
    like this ??
    SQL> select dt
      2    from ( select to_date(decode('&quarter', '1', '01-01-2008',
      3                                             '2', '01-04-2008',
      4                                             '3', '01-07-2008',
      5                                             '4', '01-10-2008'), 'dd-mm-yyyy')
      6                  + level - 1 dt
      7             from dual
      8           connect by level <= 7)
      9  where trim(to_char(dt, 'DAY')) = 'FRIDAY';
    Enter value for quarter: 1
    old   2:   from ( select to_date(decode('&quarter', '1', '01-01-2008',
    new   2:   from ( select to_date(decode('1', '1', '01-01-2008',
    DT
    04-JAN-08
    SQL> /
    Enter value for quarter: 2
    old   2:   from ( select to_date(decode('&quarter', '1', '01-01-2008',
    new   2:   from ( select to_date(decode('2', '1', '01-01-2008',
    DT
    04-APR-08
    SQL> /
    Enter value for quarter: 3
    old   2:   from ( select to_date(decode('&quarter', '1', '01-01-2008',
    new   2:   from ( select to_date(decode('3', '1', '01-01-2008',
    DT
    04-JUL-08
    SQL> /
    Enter value for quarter: 4
    old   2:   from ( select to_date(decode('&quarter', '1', '01-01-2008',
    new   2:   from ( select to_date(decode('4', '1', '01-01-2008',
    DT
    03-OCT-08
    SQL> SELECT NEXT_DAY(TRUNC(TO_DATE(SYSDATE,'DD-MON-YYYY'), 'Q')-1,'Friday') FROM dual;
    NEXT_DAY(
    05-OCT-08
    SQL>You may as well pass Year if you want by converting it to a bind variable.
    Regards
    Asif Momen.
    http://momendba.blogspot.com

  • How can I alter a calendar script to place progressive dates on every day in the calendar year?

    Is there an easy way either to alter the calendar script or create something that will allow for variable text in each day of the year?
    I am creating a calendar for a cattle rancher, and he wants to include a gestation calendar in the design.
    So...instead of the Julian date on every caledar day, he would like to include the date that a calf will be born if the cow had been bred on a particular day.  For example:  On the calendar date, January 1, in that box, another smaller date will appear - 10/9, On January 2 - 10/10 and so on. But, I need this progression to continue throughout the whole year.
    I have attempted to manually enter each date in a separate table and super impose it over the calendar, but this is very slow and very tedious. There has to be a faster way.
    I am comfortable looking at code and can often times figure out which fields to change, but I am a bit lost on this one. Where do I start?
    Please help!
    Thanks!

    That helped, but still did not solve the "continous scroll" question.
    I did however discover that if you go to Search and type in a "common" letter like "s", a Continuous List view will appear.
    Any further help on how to do this as a default view would be appreciated from any and all.
    Thanks for the help and for the link paulcb.

  • When I try to launch an adobe application I am prompted to renew my creative cloud subscription even though I'm paid up until the end of the year.

    When I try to launch an adobe application I am prompted to renew my creative cloud subscription... even though I'm pre-paid up until the end of the year. I can't use any of my applications at the moment.

    Another update: The one month free trial software is no longer working for me as a work-around.
    Also: I tried to open up my Adobe applications from two other machines that I have in the house, but it did not work. I received the same subscription renewal popup loop. This leads me to the conclusion that it is strictly an issue on the Adobe Licensing Server side, and NOT a localized issue with something wrong on my system.

  • Urgent ...! How to get Current Quarter of the Fiscal Year

    Hi Friends,
       I need to calculate current Quarter of the Fiscal Year 4 , 5 like that. SAP has Provided 3 Variable(Current Quarter of the Fiscal Year 2 like that 3 variables), my customer is looking for some more variables. Can any one help me out hhow to Calculte Current Quarter of the Fiscal Year 4. How can i see the code of the SAP EXit's. Based on that i will try to write the code.
    Thanks in Advance!
    Nagesh.

    Hi Nagesh,
    the code for SAP Exits must be in Function-Pools SAPLRS_BCT* (I'm not quite sure). But this code
    seems to work different than customer Exits.
    See How-To-Guide
    https://service.sap.com/~sapdownload/011000358700002762582003E/HowToDeriveVariableValue.pdf
    for a good example of how to implement Customer-Extis.
    (It's a 2.x Guide but still valid for 3.x)
    Regards
    Robert

  • In iTunes I click on a song and when I click on the "get info" tab, it opens up but everything is gray - locked, therefore, I cannot edit the year or genre of the songs. Not every song is locked, only certain ones for some reason. Any help?

    In iTunes I click on a song and when I click on the "get info" tab, it opens up but everything is gray - locked, therefore, I cannot edit the year or genre of the songs. Not every song is locked, only certain ones for some reason. Any help?

    I ran into the same problem, I think that, If you tab on a song that is on your IPOD, and the song data is grayed-out, I think it means that the song is probably twice on your IPOD and that the iTunes directory can not edit THAT song data for two (or more) files @once. Check if this is the case, sinceI have the same problem,am looking for a way to have One and the same song in more playlists but only keep the song once on the IPOD.

  • In Win 7 64bit I get the following error upon every reboot.  "The procedure entry point xmlTextReaderConstName could not be located in the dynamic link library "    This happened yesterday, 8/23/2011 after downloading Apple iTunes 10.4.

    This happened yesterday, 8/24/2011 after downloading Apple iTunes 10.4. In Win 7 64bit I get the following error upon every reboot.  "The procedure entry point xmlTextReaderConstName could not be located in the dynamic link library libxml2.dll"    Please how do I fix this, Thanks.

    In the case that your OS is Windows 7 (64 bit)
    1. Open windows explorer, go to location C:\Program Files (x86)\Common Files\Apple\Apple Application Support
    2. Copy file "libxml2.dll"
    3. Open new windows explorer, to to location C:\Program Files (x86)\Common Files\Apple\Mobile Device Support
    4. Paste file "libxml2.dll" to the location.
    5. Reboot your computer, it should not display that message, it should be clear.
    Good Luck

  • Get the half of the year (like quarter)

    Hi guys,
    I need to get the "half" of the year.
    I am using the following...
    Case
    When CAST(DATEPART(quarter, Stock.VALUEDATE) as int)= 1 then '1'
    When CAST(DATEPART(quarter, Stock.VALUEDATE) as int)= 2 then '1'
    When CAST(DATEPART(quarter, Stock.VALUEDATE) as int)= 3 then '2'
    When CAST(DATEPART(quarter, Stock.VALUEDATE) as int)= 4 then '2'
    Else 'UnKnown'
    End AS 'Half',
    Is there any more elegant solution?  something like
    DATEPART(half,Stock.ValueDate) AS 'Month'
    Thanks.

    this is the same as your logic, but using month... and in one line:
    datepart(month,stock.[VALUEDATE])<=(6) then '1' else '2' end)
    Or you can use Quarter:
    datepart(quarter,stock.[VALUEDATE])<=(2) then '1' else '2' end)
    Also, you may want to use 'Semester' rather than 'Half'.  The term 'Semester' suggests a date range, while 'Half' does not.... ALSO, in another field, you may want to concatenate the year to get a string result like '2013S1'.  Having the year with
    the semester, quarter, or month, will help with grouping and other date based calculations.
    here is the datepart function
    http://msdn.microsoft.com/en-us/library/ms174420.aspx

  • I'm in a bind... Over the years I have purchased a good amounts of apps. Some has hacked my apple I'd changed my security questions and was charging me money every month. When I went to cancel the purchases through my bank my account was disabled. Help me

    I'm in a bind... Over the years I have purchased a good amounts of apps. Some has hacked my apple I'd changed my security questions and was charging me money every month. When I went to cancel the purchases through my bank my account was disabled. Help me

    No I did not change the email that I used to create the account.... Someone made new security questions and when I went to change them I had to verify and it sent the answers to an email address... Get this though... The email address that it sent the answers too waste letters in the middle were starred out like this t*****@aol.com. That's not my email. Why did it not send the questions to my apple ID email account right? if you know how to change the email to a new one that would be awesome if you could share that info with me.

  • Quarter of the financial year

    hello friends
    is their any function module to calculate the quarter of the financial year

    hello,
    use fm HR_99S_GET_QUARTER
    greetings
    Andreas

  • Query based on every quarter

    Hi All,
    I have a date table which consists of four fields two which are defined as varchars and two which are defined as numbers. One of the varchar fields holds a period in a mmyyyy format and the second one holds a date in yyyymmdd format.
    I need to use this information to get every quarter between two periods e.g 012004 and 032007. Is this possible with the information I have or would i need a new field in the table which holds the quarter relating to each period
    Thanks in advance for your help

    It's best to hold dates in date fields. To get the quarter from a date you can use the Q format mask, eg
    SELECT To_Char(SYSDATE,'YYYY-Q') FROM dual;
    so you just need to To_Date() one of your varchar columns and apply that function.
    Are the period and date fields ever going to contain data with different months/years? If not then you could store only the date (in a date type) and use trunc to get the month portion when you query the records, eg
    SELECT Trunc(SYSDATE,'MM') FROM dual;

Maybe you are looking for

  • Jabber for Windows Call popup photo

    We have a Jabber for windows deployment currently running in our lab environment. In the buddy list we have the contacts with their photo. When we start a call or receive a call a call popup screen appears. In this screen the photo of the called pers

  • Can somebody help me regarding BAM(business activity monitoring tool)

    hi, can somebody tell me regarding BAM. thanks

  • Images not showing on ebay?

    Ever since yesterday I've logged onto ebay and when I've searched for something the images won't show. When I first enter the site all the images are there, but if I search for something no images pop up next to the descriptions however if I click on

  • Images not visable in firefox

    Hi all, i'm only new to this but here is the problem that i am having. I'm using Dreamweaver 8 to design web pages. When saving an excel spreadsheet with an image on it plus other data as a web page to use in dreamweaver i have the problem that if i

  • How can one make the drop down list of bookmarks disappear when selecting an item?

    I want the list to close automatically when selecting a bookmark to open the page (as it does with favourites in Internet Explorer 8). Is it possible to set this up or does the list always have to be closed manually?