Check Sysdate for a specified Time

Hi,
I have requirement to check sysdate for particular time in a script,If it has systime is equal to that time in the evening, I need to exit the script and write messages to log file. I am doing the following but it's not working properly, Can anybody help with this?
if sysdate > to_date('19:20','HH24:MI')then
v_timeout := 'Y';
v_output := 'Database Shutdown time... Exiting Script';
utl_file.put_line(v_file_handle, v_output);
Thanks
Kalyan
exit;
end if;

to_date('19:20','HH24:MI')The date out going by this command is the first day of the current month...
SQL> select sysdate, to_date('19:20','HH24:MI') from dual;
SYSDATE             TO_DATE('19:20','HH
14-04-2008 13:19:42 01-04-2008 19:20:00You have to use the current day instead :
SQL> select sysdate, trunc(sysdate)+19/24+20/1440 from dual;
SYSDATE             TRUNC(SYSDATE)+19/2
14-04-2008 13:21:21 14-04-2008 19:20:00Nicolas.
Paolo, how did you made ? I have a opened window without your response above mine, and an other with your post... hmmm some strange forum behaviour...
Message was edited by:
N. Gasparotto

Similar Messages

  • Refresh IE page if computer idle for a specified time with powershell

    Hi,
    I have a Windows 8 pc that i have created a kiosk mode for and i want to be able to check the idle time so that if the idle is more than three minutes it will close all tabs without a warning and navigate the primary tab to a specific web site.
    The script needs to be constantly running i the background, I'll add the script to a scheduled task to start when the user logs in.
    Could you please help me?
    Cheers,
    CredFX

    The Windows 8 computer is a touch screen as well so idle means any mouse movement, keyboard stroke or touch of the screen.
    I have found this from a site that gets the idle time, I'm just not sure how to create the IE navigation part from it.
    Add-Type @'
    using System;
    using System.Diagnostics;
    using System.Runtime.InteropServices;
    namespace PInvoke.Win32 {
    public static class UserInput {
    [DllImport("user32.dll", SetLastError=false)]
    private static extern bool GetLastInputInfo(ref LASTINPUTINFO plii);
    [StructLayout(LayoutKind.Sequential)]
    private struct LASTINPUTINFO {
    public uint cbSize;
    public int dwTime;
    public static DateTime LastInput {
    get {
    DateTime bootTime = DateTime.UtcNow.AddMilliseconds(-Environment.TickCount);
    DateTime lastInput = bootTime.AddMilliseconds(LastInputTicks);
    return lastInput;
    public static TimeSpan IdleTime {
    get {
    return DateTime.UtcNow.Subtract(LastInput);
    public static int LastInputTicks {
    get {
    LASTINPUTINFO lii = new LASTINPUTINFO();
    lii.cbSize = (uint)Marshal.SizeOf(typeof(LASTINPUTINFO));
    GetLastInputInfo(ref lii);
    return lii.dwTime;
    Function getidletime
    $Last = [PInvoke.Win32.UserInput]::LastInput
    $Idle = [PInvoke.Win32.UserInput]::IdleTime
    Write-Host ("Idle for " + $Idle.Days + " days, " + $Idle.Hours + " hours, " + $Idle.Minutes + " minutes, " + $Idle.Seconds + " seconds.")

  • Howto get Measure values for a specified time interval

    hello,
    I am building a BIBeans application where in i need to display a crosstab depending upon user defined time period.So, I need to provide 2 text fields which can be populated with a user specified calendar date for specifying the time range..Then I need to display the details according to this user entered time period. I would like to know how to achieve this if the time dimension can be drilled upto an individual date.Can any one help me in this regard?
    Thanks in advance
    Rags

    Hi Katarina :
    your code is "MDDimension timeDim = metadataManager.getDimensionByUniqueID(timeDimensionID);"
    the variable "metadataManager" is instance by " MetadataManager metadataManager=new MetadataManager()".
    Is right above?
    but I run it ,the programe throw a exception.
    why do it throw this question?I hope you can answer me .thank you !!
    the exception is following :
    java.lang.NullPointerException
         oracle.dss.metadataManager.common.MDObject oracle.dss.metadataManager.client.MetadataManager.getMDObject(oracle.dss.metadataUtil.PropertyBag)
              MetadataManager.java:1763
         oracle.dss.metadataManager.common.MDObject oracle.dss.metadataManager.client.MetadataManager.getMDObject(java.lang.String, java.lang.String, java.lang.String)
              MetadataManager.java:3323
         oracle.dss.metadataManager.common.MDDimension oracle.dss.metadataManager.client.MetadataManager.getDimension(java.lang.String, java.lang.String)
              MetadataManager.java:3424
         oracle.dss.metadataManager.common.MDDimension oracle.dss.metadataManager.client.MetadataManager.getDimensionByUniqueID(java.lang.String)
              MetadataManager.java:3615

  • How to disconnect from internet for a specified time?

    Hi, I just read about an application that allows you to set times when your computer is disconnected from the internet. Unfortunately, the name of the application was not mentioned, nor whether it runs on a Mac or not. Does anyone know of such an application? It could come in handy in increasing one's kids' (and one's own) productivity.
    Thank you.
    M. Chaouli

    Thank you for the helpful response. What I really want is a program that lets me sever all connections to the internet (e-mail, web, i-chat, etc.) for specified periods of time. Perhaps parental controls allows this. I'll have to look into it.
    Thanks again,
    mc

  • Running a thread for a specified time

    my main program has 10 threads. i want to run each thread for 30 secs . but if one thread is on progress it may be allowed some time to complete its task otherwise evrbody should return after 30 secs.how can i do it ?
    thankx

    code is hanging...
    also how do i do >>if one thread is on progress it may be allowed some time to complete its task otherwise evrbody should return after 30 secs
    class Shared
    boolean stop=false;
    // do nothing but helps only for synchronisation
    class ThreadProducer1 extends Thread
    {    Shared obj;
         public void run()
         {   long endTime = System.currentTimeMillis() + 30 * 1000;
             long currentTime;
              for (int k=0;k<1000;k++)
              {System.out.println("thread1");     // doing its work
             currentTime=System.currentTimeMillis();
              if (currentTime>endTime) break;
    class ThreadProducer2 extends Thread
    {   Shared obj;
         public void run()
         {   long endTime = System.currentTimeMillis() + 30 * 1000;
             long currentTime;
              for (int k=0;k<1000;k++){
              System.out.println("thread2");     // doing its work
              currentTime=System.currentTimeMillis();
              if (currentTime>endTime) break;}     // doing its work
    class ThreadProducer3 extends Thread
    {   Shared obj;
         public void run()
         {   long endTime = System.currentTimeMillis() + 30 * 1000;
             long currentTime;
              for (int k=0;k<1000;k++)
              System.out.println("thread 3");     // doing its work
              currentTime=System.currentTimeMillis();
              if (currentTime>endTime) break;
              }     // doing its work
    class Test
    public static void main(String argv[])
        try{
         ThreadProducer1 t1 = new ThreadProducer1();
         ThreadProducer2 t2 = new ThreadProducer2();
         ThreadProducer3 t3 = new ThreadProducer3();
         t1.start();
        t2.start();
         t3.start();
        Thread.sleep(30000); // main thread wakes up after 30 secs.
         }catch (InterruptedException ex)
             System.out.println("exception");

  • If I sign up for 3g service on my iPAD, can I easily get Verizon to turn it off for a specified time...I might be in a Wifi area...or I might need to save some money on service I don't need for awhile.

    If i sign up for 3g service on m iPAD with Verizon, can I easily discontinue the 3g for awhile when I don't need it; then have Verizon turn it back on when I contact them?  Will they charge me for that on/off service?

    We don't work for Adobe. We are just users.
    You'll want to take this to the proper forum for that product at Adobe PDF Pack (read only)
    Good luck.

  • Lock Frontpanel when user takes no activity in a specified time

    Hello !
    I have a PanelPC with Touchscreen and want to lock the frontpanel when the user doesn't make an input for a specified time. After this time the frontpanel locks and shows a password input to unlock the frontpanel. How do i detect if the user makes no input ? The VI has to run, because it makes an automatic control/ regulation of a factory. I found an example with a password protection, but i don't know how to detect the user input. Can anyone help me ?

    You can monitor the "mouse events" and also the "keypress events (using the keyboard)" and with this FP can be locked/unlocked based on the time out. 
    Create an event structure so that it will be easy to handle the mouse events. Add another frame of this event structure which can be used for handling the timeout and when ever a event occurs on the FP you can reset it to 0
    Regards
    Guru (CLA)
    Attachments:
    timeout.vi ‏13 KB

  • How to run a VI for very short time, e.g. 100ms?

    Hi,
    I need to run a VI for very short amounts of time, say 100ms, 200ms, 500ms or 1s. I want to get this time from the user, maybe as a control variable. How may I do this? I tried using the "elapsed time" function but seems like it was not meant for such small time periods. Any ideas?
    Thanks
    Kaiser 

    What are you trying to do in the "short time"? When you say "run a VI" do you mean "start, run and stop running", or do you mean for the vi to do something for the specified time, i.e. flash a front panel LED for a precise period after the operator clicks a button? In the later case 100mS is actually fairly long, and can be accomplished with various timing functions, with varying degrees of accuracy. The most accurate, in a Windows environment, would probably be the timed loop. If you need really accurate, particularly if you are interfacing with hardware (a pushbutton, an actual lamp, etc.) a real-time system would be the best bet.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Every time I TRY to start firefox 18-19 I get an error message : Firefox has stopped working - close the program and check online for a solution - or - close ..

    Every time I TRY to start firefox 18-19 I get an error message : "Firefox has stopped working" - "close the program and check online for a solution" - or - "close the program" this happens TWICE every time I try to start firefox. Eventually after a random number of tries firefox will start normaly. I am useing firefox 19.0.2 now bit I belive it started when I upgraded to firefox 18 but am not sure, it might have been when I upgraded to firefox 19 ... but it has been happening for a very long time and I cannot find any helpfule solutions online.
    I have tried a Clean reinstall but it did not help.

    Hello,
    '''Try Firefox Safe Mode''' to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * You can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''
    Thank you.

  • Every time I TRY to start firefox 18-19 I get an error message : Firefox has stopped working - close the program and check online for a solution - or - close th

    Every time I TRY to start firefox 18-19 I get an error message : "Firefox has stopped working" - "close the program and check online for a solution" - or - "close the program" this happens TWICE every time I try to start firefox. Eventually after a random number of tries firefox will start normaly. I am useing firefox 19.0.2 now bit I belive it started when I upgraded to firefox 18 but am not sure, it might have been when I upgraded to firefox 19 ... but it has been happening for a very long time and I cannot find any helpfule solutions online.

    Certain Firefox problems can be solved by performing a ''Clean reinstall''. This means you remove Firefox program files and then reinstall Firefox. Please follow these steps:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from http://www.mozilla.org and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (click Exit from the Firefox or File menu).
    #Delete the Firefox installation folder, which is located in one of these locations, by default:
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    Please report back to see if this helped you!

  • How to get the values multiple times for the specified element - ABAP IXML.

    Hi all,
             i have requirement to get the values for the specified elements multiple times. eg:., if the element is used in the xml 4 times then i need to get all the 4 values.  here is the sample xml,
    <View mmRelease="6.30" mmVersion="2.0" mmTimestamp="1180099591892" name="Comp_viewtestView" package="sap.com" masterLanguage="en">
    <AbstractView.InboundPlugs>
    <InboundPlug name="ip2">
    <ParameterizedFeature.Parameters>
    <Parameter name="ippara2">
    <Parameter.Type>
    <Core.ForeignReference modelName="DtDictionary" package="com.sap.dictionary" name="binary" type="DtSimpleType"/>
    </Parameter.Type>
    </Parameter>
    </ParameterizedFeature.Parameters>
    </InboundPlug>
    <InboundPlug name="hi">
    <ParameterizedFeature.Parameters>
    <Parameter name="hipara">
    <Parameter.Type>
    <Core.ForeignReference modelName="DtDictionary" package="com.sap.ide.webdynpro.uielementdefinitions" name="Visibility" type="DtSimpleType"/>
    </Parameter.Type>
    </Parameter>
    </ParameterizedFeature.Parameters>
    </InboundPlug>
    Here i need to store the following values in internal table, the element to get the values are,
    (1) InboungPlug name and the respective values of "Parameter name" and "Parameter type" name value.
    The output will be of 2 records & values should be
    Inbound plug name = ip2
    Parameter name    = ippara2
    Parameter type      = binary
    2nd record
    Inbound plug name = hi
    Parameter name    = hipara
    Parameter type      = Visibility
    These 2 records should be in internal table and then i will be passing to database table...
    Can anyone provide me the code for the above......
    Thanks in advance,
    Vishnu.

    I didn't get ur requirement..
    As per my understanding, upload the XML file into an internal table and then loop over the internal table and get the values for ptype and pname..
    XML ABAP  -  may b helpfull
    Edited by: Veeranji Reddy on May 7, 2009 2:10 PM

  • How do I set my mail folders to keep items saved there indefinitely while only keeping mail in my active mailbox for a specified period of time?

    How do I set my mail folders to keep mail saved there available indefinitely while only keeping active mail in my mailbox for a specified period of time?

    There is no time limit in Firefox 4+ versions for the history.<br />
    Firefox determines automatically how many pages can be kept without affecting the performance.<br />
    You can see the current value via the reads-only pref places.history.expiration.transient_max_pages on the about:config page.
    See:
    * http://blog.bonardo.net/2010/01/20/places-got-async-expiration
    If you lose the history then make sure that you do not use Clear Recent History to clear the browsing history.<br />
    Also make sure that you do not have cleanup software that might clean up files in the Firefox Profile Folder.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    *Firefox > Preferences > Privacy : History: [X] Clear history when Firefox closes > Settings
    *https://support.mozilla.org/kb/Clear+Recent+History

  • How do I insert a pdf file (image) into a project as a picture-in-picture clip that will run for a specified amount of time?

    I want to insert a pdf created from a ppt slide into a FCP X project that will run as a PIP for a specified amount of time. I was successful in bringing the image into the project as a clip but the default for the image is one second. When I try to change duration of the clip, I am able to enter a new time length but the actual clip doesn't change.

    You select the PDF image in the timeline. You use Control-D and enter the new duration. What happens?

  • Hello I'm trying to create Apple ID without success for a long time. And after checking with the bank details are correct with no success

    Hello I'm trying to create Apple ID without success for a long time.
    And after checking with the bank details are correct with no success

    If you choose US as your country while your bank details and credit card or PayPal account are from another country, then you will get an error not related to your details, such as 'the CVV number is incorrect', although it is correct.

  • Repeat credit check does not happen for already released sales orders when CMGST =D, for the second time using FM SD_ORDER_CREDIT_CHECK

    Hi,
       I have written a routine which will call the FM SD_ORDER_CREDIT_CHECK whenever there is a rejection and again unrejection of a same sales order, we are only concerned about already credit released sales orders, the scenario is as follow
    1). Sales order created in the system --> Credit check --> Credit blocked
    2). Release credit block manually CMGST =D
    3). Reject sales order then unreject the same
    4) Routine will determine rejection and unrejection of the order while saving and will call the FM SD_ORDER_CREDIT_CHECK
    5)   The order is credit checked and blocked if necessary
    All goes well till this point
    but when the same sales order is rejeceted and unrejected multiple times either partially/ fully then the Custom routine calls the FM for credit check but the FM fails to put the order back on credit hold
    in short the FM works only for the first time incase of mutiple rejection and unrejection of teh same sales order then the FM SD_ORDER_CREDIT_CHECK fails to put the order back on credit hold from the second time onwards
    if some one any idea of the behavior of this FM please share your thoughts and inputs . thanks !!

    Issue resolved
    The Standard FM “SD_ORDER_CREDIT _CHECK” uses the field  “Release date of the document determined by credit management  VBAK – CMFRE”
    For any sales order that is manually credit released in a single day, Only one credit check is triggered (per day) if there is any change in the sales order and then the order goes back to credit hold and if again the order is manually credit released for the second time in a single day there will be no credit check  (still the order will pass into FM but  the update entry in the internal table will be blank)this is a standard functionality
    Process of rejection and unrejection :
    Blocked order -->released-->blocked again (first time after manual release same day) unrejected (same day) -->but no credit check  (all this in a single day)
    note : OVA8 - released document still unchecked = 0 Days , Deviation %= blank

Maybe you are looking for