procedure to run every month only once if I press the button

Hi........

I want to run the procedure every month once, if I press the new button in the same month I want displaying the message "executed procedure.
in fact I used the function procedure when the shutter release button

I wrote this code

Declare
number of v_months;
date of T_DATE;
Start
v_months: = 0;
SELECT TO_CHAR (ADD_MONTHS(sysdate,v_months), 'DD-MON-YYYY') in the T_DATE FROM DUAL;
If T_DATE = sysdate and: CONTROL_1.COST_AFTER_DEPR is not null then
DEPRECIATE_PKG.main;

elsif: CONTROL. ASSET_GROUP is null then
fnd_message.set_string ("asset is not available");
fnd_message. Show();
raise form_trigger_failure;

elsif: CONTROL_1.COST_AFTER_DEPR = 0 then
fnd_message.set_string ("' complete depreciation");
fnd_message. Show();
raise form_trigger_failure;
end if;

end;

How can I please give me a solution

Concerning
Maha

Hello

You should have a database table to store the fact that the procedure was performed for a given month:

create table t_monthly_procedure
(
  ddate  date
)

If the procedure was executed this month then test in your code. Otherwise, you insert a row

Declare
  ln$dummy pls_integer;
Begin
  select 1
  into  ln$dummy
  where exists
  ( select 1 from t_monthly_procedure
    where to_char(ddate,'YYYYMM') = to_char(sysdate,'YYYYMM')
  );
  -- found ? --
  -- do nothing or raise a message --
Exception
  when no_data_found then
   -- nothing done for this month, so insert --
  insert into t_monthly_procedure (ddate) values (sysdate) ;
End;

François

Tags: Oracle Development

Similar Questions

  • Iconia tab 7 A1-713. There is no 'restart' menu only "turn off" when press the button / stop

    Hello, is there no 'restart' menu on the screen when pressing the power since bought button tab. It displays only a menu of "turn off." How to solve this, please. Thanks anyway

    I can't find info on a restart in the menu stop although it would make sense.

    If she was here before, then you have EVS data and do a Factory reset.

    http://Acer--UK.custhelp.com/app/answers/detail/A_ID/29892/~/Acer-Iconia-B1-A71-and-B1-710-factory-d...

  • [Beginner] Start button run sub vi only once

    Hi, I am very confused by what it seems, very simple task.

    I have a piece of code and I need to connect it to 'start' button that will run once when the button is pressed, run once more, if I press the button again and so on.

    I tried with 'while' loop and true/false button connected to him, but, as you know, code inside the loop runs continuously as long it is true which is incorrect, it does not stop when it should.

    I woul hold it like this: press start-> code in the block runs once and that's it, no more unsless I press the new button...

    Please advice.

    PS: I have attached the vi piece I need to connect with button. He is currently working as intended but I can't seem to make it executable with button.

    An event loop is the way to go, but since you're a beginner. This is the Basic, simple way:

    You must click with the right button and change the mechanical action of lock when you press on (or exit) to run only once.  If you set it to spend it will switch.

  • I had to replace the hard drive on my computer and lost the installation that I pay every month for. How to install the Adobe Acrobat Pro XI on the computer again?

    I had to replace the hard drive on my computer and lost the installation that I pay every month for. How to install the Adobe Acrobat Pro XI on the computer again?

    You can download using any one of the 3 methods.

    But if it's XI Acrobat Standard, only the first step will work.

    For Acrobat Pro XI, you can use one of the 3 methods.

    1)

    Sign in to www.cloud.acrobat.com

    Then sign Adobe ID and password, and once logged in, click on the Acrobat button, it will provide you download link.

    2)

    You can download Adobe Creative Cloud applications:

    https://creative.Adobe.com/products/creative-cloud

    Reference: download, install, update or uninstall applications

    3)

    You can download it from Acrobat Pro XI of direct download link.

    During installation, select the optoin: installation using the serial number / subscription.

    Download Acrobat products | Standard, Pro | DC, XI, X

  • Hi, my videographer of windows program opens only once. It is impossible to reopen it unless I restart the pc. And then he does that only once and then comes the same problem. Thank you

    Hi, my videographer of windows program opens only once. It is impossible to reopen it unless I restart the pc. And then he does that only once and then comes the same problem. Thanks in advance

    Just a thought...

    It may be interesting to try to open Movie Maker and go to...
    Tools / Options / compatibility... tab and left click of the
    "Restore all defaults" button / OK.

  • Why does the camera on iPhone last several images when I press the button once?

    Why does the camera on iPhone (5 c) last several images when I press the button once?

    Also, WHY when I email it to myself not come to my Inbox in?

    Sylvee

    1. When you press the button for too long, you take, what we call, Photos of Burst. It's getting so you can choose the one that needs to be said, a sequence of quick action. Practice a tap faster the button to avoid this problem.

    2. Please explain in more detail.

  • Libretto W100 - keyboard won't go away when I press the button yet once

    Hello

    I have a Libretto W100 and I need to make the keyboard disappear by pressing the keys on the keyboard on the left.

    I formatted the booklet and installed all the drivers.

    After the format I run the application of Toshiba button support and registered the button KB (single click), to the path target C:\Program Files\Toshiba\Libretto\TOSSWKBA.exe

    The keyboard appears on the screen when I press the button, but it will not disappear when I press again.
    Maybe I need to put something in the option field.

    Thanks for your help.

    Hello

    I read in another thread that Kaspersky 2010 version was not compatible with the touch screen of booklet.
    The new 2011 version seems to be compatible.
    Maybe you need to use the latest version

    Check it!

  • I recently created a form to complete for the app e-business of the company. When you press the button submit, he only sent to our Inbox to project and not sent to the e-mail provided in the URL. Can someone help us to program the key to help explain why.

    I recently created a form to complete for the app e-business of the company. When you press the button submit, he only sent to our Inbox to project and not sent to the e-mail provided in the URL. Can someone help us to program the key to help explain why / tell us step by step what we should do?

    OK, I re-read your question. It's actually expected behavior. The user must manually send the email.

    If you want it to be a silent process, then you must either install a script on the local computer of the user who will do this, or use any email but something as a service web to which you directly submit the form data.

  • Just downloaded book dear DW CC. ' Bought that tells me to use "Workspace expanded", but the only options I see in the button of the window or workspace are 'Design' excerpt ' and from each other. No where can I find the 'Expand' or 'Compact' that says th

    Just downloaded book dear DW CC. ' Bought that tells me to use "Workspace expanded", but the only options I see in the button of the window or workspace are 'Design' excerpt ' and from each other. No where can I find the 'Expand' or 'Compact' that says that books are the two choices.

    The book you bought is for an older version of DW.  Which one, I don't know.  Changed a lot in the 2013, 2014 in June and October 2014,1 releases of CC.  Books are usually at least 1 version and sometimes 2 obsolete versions.

    CC 13

    Using Dreamweaver | Summary of new features

    CC 20141

    Using Dreamweaver | Summary of new features

    Nancy O.

  • Conditional formatting: press the button run javascript

    I have a few fields of summary of the sections. I want to use a button that when press focuses on these areas and if their individual sums up are superior by some number that I chose, another separate field becomes hidden. Well, I have this part down pretty well, but when I have the clear form, this hideable field becomes visible again.

    Here's what I have so far for the javascript button:

    If ((getField("TOTAL_Y").value = '0') & & (getField("Total_Question").value = '0'))

    {

    getField("exclude_or_include").display = display.visible;

    }

    on the other

    {

    ((getField("TOTAL_Y").value > '0') |) ((getField("Total_Question").value > '4')) ;

    getField("exclude_or_include").display = display.hidden;

    }

    If you use this code in the custom calculation of a hidden text field script, it will update visibility of the field "exclude or include" automatically if you do not have to press the button. It runs whenever a field value changes, which includes whenever the form is reset. In comparison, remove the quotation marks around the numbers if you intend to make digital comparisons.

    This first line should be reduced to:

    If (getField("TOTAL_Y").value == 0) & (getField("Total_Question").value == 0))

    What do you what that line of code do? :

    ((getField("TOTAL_Y").value > '0') |) ((getField("Total_Question").value > '4')) ;

  • If I press the button 2 times to run the query 2 times

    Hello..

    If I press the button 2 times to run query 2 times
    I want to limit this problem, than a run time enough.
    no need to rerun query when I press the button because it will make the erroneous data.

    Please give me a solution
    Maha

    Hello Maha

    did you use KEY-EXEQRY trigger and turn off the query button?

    SET_ITEM_PROPERTY('BLOCK1.) REPRINT ', ENABLED, PROPERTY_FALSE);

    Sorry not clear for me, but plu everything sounds good :)

    Kind regards

    Amatu Allah

  • How to call the stored procedure when I press the button

    Hello

    I want to know how to call the procedure/SQL statement when I press the button using callable statement.

    can someone give me it please link who knows the steps to do this.

    Thanks in advance,
    SAN

    Hello

    read this good example http://www.baigzeeshan.com/2010/05/calling-plsql-procedure-and-function-in.html

    ~ Abhijit

  • Submit a job to run every month.

    Hello

    I have Oracle 10g DB and I'm new on the job scheduling. I need to schedule a task that calls a procedure every month on the first. The procedure takes two dates as a parameter and inserts transactions during the month (between two dates) in a table. Could you please let me know how to plan the work for the 1st of every month following script? I give you the script below I run manually.


    EXEC XX_VOUCH_SUM (to_date ('01:00 07\01\2010', 'MM\DD\YYYY HH24:MI:SS'), to_date ('07\31\2010 23:59:59 ', ' HH24 MM\DD\YYYY:MI:SS'))))

    I appreciate an early response.

    Kind regards
    Raj.

    Of course, you just need to adjust the start_date and interval

    DECLARE
      l_jobno INTEGER;
    BEGIN
      dbms_job.submit(
        l_jobno,
        'BEGIN XX_VOUCH_SUM( trunc( add_months( sysdate, -1 ), 'MM' ), last_day( add_months( trunc(sysdate), -1 ) ) ); END;',
        trunc( add_months( sysdate, 1 ), 'MM' ) + 4,
        'trunc( add_months( sysdate, 1 ), ''MM'') + 4' ) ;
    END;
    

    Note I've also fixed a problem where I forgot to trunc (sysdate) inside the last_day get rid of the component "hour". I suppose you want the second parameter at midnight the last day of the month.

    Justin

  • Beginner question - sheet opens only once when opened via the app bar

    I have a spreadsheet component very simply defined in my main.qml like that

    {Sheet
    ID: mainPageSheet
    content: Page {}
    Button {}
    text: "close map".
    onClicked: {mainPageSheet.close ()}
    }
    }
    }

    I open app bar using settingsActionItem

    Menu.Definition: MenuDefinition {}
    settingsAction: {SettingsActionItem}
    Title: qsTr ("Settings")
                 
    onTriggered: {}
    mainPageSheet.setContent (settingsSheetComp.createObject ());
    mainPageSheet.open)
    }
    }

    }

    Now my problem is that it doesn't open that only once, the next time he shows nothing and gesture swipe to lower the bar of application stops responding also. because I do not have much that I am little confused what wrong here

    I use the Simulator on SDK Gold

    The Simulator today update fixed

  • Visa read only works after press the button run

    Hi people.

    I have a weird problem here. When I run the vi and press the Start button that the serial port is read and in the rest of the program works very well. When it is finished and do it again there is no data series. I have to give up and re - run, then when I push the button to start the serial data are there. The end of the program is somehow the serial port to an unknown state?

    Thank you

    Select this option.

    You may have found an error in your devices.  and, since you do not have initiallize the shift register with the grouping of the IO Sessions and mistakes the SR will retain the error while the vi is in memory, unless you give up running (how the shift register will contain the default value).  Find the error

Maybe you are looking for