Back to ErrorLevel == 1 (or non-zero) If compare does not

All,
I have several regular processes that run each week. I use a task scheduler that calls a batch file. The batch file will connect to sqlplus and runs the specified sql file. For the process in question, there is a table that has a date of report. If the date of the report does not match the date I want, I want the sql script to terminate / exit and return an errorlevel code 1 (or non-zero) and the rest of the script is not running. If the report dates are equal, I would like the script to complete. I tried to use an raise_application_error if, goto, instruction, etc... and I can get the sql script ends. However, I can't seem to return an errorlevel code 1 (or non-zero) in my batch file. She returns always an errorlevel == 0 or successful. Someone has suggestions that will run a comparison of date and error / return errorlevel == 1 (or whatever) if the dates do not match? Any help you give would be greatly appreciated.

Thank you
CC

You have instructions in the wrong order, try this:

WHENEVER oserror exit 1;
WHENEVER SQLERROR EXIT 1;
--/********************************************************************
--*
--* Check to see if the report_date is updated if not error out
--*
--*********************************************************************/
DECLARE
   report_date1   DATE
                := LAST_DAY (TO_DATE (ADD_MONTHS (SYSDATE, -2), 'DD-MM-RRRR'));
   report_date2   DATE;
BEGIN
   SELECT report_date
     INTO report_date2
     FROM tablename
    WHERE report_flag = 16;

   IF (report_date1 != report_date2)
   THEN
      RAISE_APPLICATION_ERROR(-20000,'INVALID PROD NO');
   END IF;
END;
/
--/********************************************************************
--*
--* Continue processing the stuff...
--*
--*********************************************************************/
-- rest of sql here --
COMMIT;
EXIT 0;

: p

Tags: Database

Similar Questions

  • I just upgraded to 10 Windows and now I can't get into Photoshop Elements.  I get the error 150:30.  Set to zero, as suggests, does not, of course.

    I just upgraded to 10 Windows and now I can't get into Photoshop Elements.  I get the error 150:30.  Set to zero, as suggests, does not, of course.

    Thanks - I thought that this could be the best answer!  I just hope that, in general, PSE 8 works with W-10!

  • Have been CC because it came out; now when I sign on Adobe indicates that I am trial with so many days left.  No SN check reviews like that I usually get. Want to come back to the subscription version that the trial version does not provide

    Have been CC because it came out; now when I sign on Adobe indicates that I am trial with so many days left.  No SN check reviews like that I usually get. You want to revert to the version of subscription that the trial version does not include updates as new versions of camera raw.  How can I get this problem?

    Hello

    Please, you can consult the links below-

    Kind regards

    Sandrine

  • Wireless zero configuration service does not properly

    OK, here's what I did:

    1A started with a fresh install of windows xp pro sp3

    2 installed EDIMAX usb wireless adapter

    3 downloaded all the critical updates available for the operating system

    4 installed several other pieces of hardware, microsoft office, Photoshop, Avast antivirus, etc..

    At different points along the way, the restore points were made.

    Everything was hunky dory until the very last point to install a HP printer....

    On his return from a restart of the system, cannot connect wireless adapter.

    The window that lists the wireless connections available indicates that windows cannot configure the connections because some other wireless software apparently resumed its function.

    He said that if I wanted to have windows set it up for me, I could restart it from services.msc.  When I arrived, I found the wireless configuration service was set to automatic, however she didn't start.

    I then resumed, after started what it remained only for the rest of the session.  When the computer has been restarted, he returned to the same State as before.

    I then tried all available system restore points, which could NOT be restored.

    I tried to uninstall the faulty printer drivers and software, which also did not fix the problem.

    In desperation, tried a Microsoft Fixit applet which is supposed to be a disable half dozen services known to cause this problem, but as far as I could tell, they have never been installed on this machine.

    Does anyone have any other suggestions as to how I can resstore this system to work properly?

    Number 1 (WPS2.0 HW PBC Service) is a service of Edimax associated your Edimax wifi card

    Number 2 (Wired AutoConfig) is the built-in Windows service that is used with your wired (Ethernet) network card.  She appeared in XP service pack 3.

    Number 3 (Wireless Zero Configuration)
    is the integrated service of Windows that configures your wireless adapter.  You can have only one service running to configure your wireless network card: is WZC or Edimax service.

    "WPS" stands for "WiFi Protected Setup" and "PBC" is the term of Edimax for "Press the Configuration button."  These two relate to a method of security configuration of wireless networks that has been designed to allow 'users at home who know little of wireless security and may be intimidated by the available security options' to set the security on their wireless networks.  Unfortunately, WPS has found to have security holes (click the link to the Wikipedia article for more details).

    In any case you don't need number 1, especially once your network has been configured with appropriate encryption.  As to why install a HP printer might have caused the problem, I can only speculate: is your printer a wireless printer?  If so, he may very well have included the version of HP of WPS... who have somehow damaged the Edimax installation.

  • None of my screensavers does not work and that they have problems with direct3D

    Original title:

    I HAVE WINDOWS VISTA AND NOW IT SAYS SCREEN SAVER IS NOT COMPATIBLE WITH DIRECT3D, I HAVEN'T CHANGED ANYTHING WHAT CAN I

    I have windows vista home edition and have not upgraded to windows 7.  Now all of a sudden, I get a message that none of my screen savers work and they have problems with direct3D.  I don't know what happened.  What can I do? t

    Also, I need the sp1 and sp2 to upgrade my internet explore for later and I can't find these service packs for free anywhere. Please what can I do?  Thank you Tamara

    Hi Tamara,

    1. What is the brand and model of graphics card?

    2 - is the question also occur with the screen savers that come with Windows Vista?

     Download and install the latest video card driver.

    a. visit the system manufacturer's Web site, download the Vista compatible video card driver and install it.
    b. restart the computer so that the changes take effect after the driver installation.

    http://Windows.Microsoft.com/en-in/Windows-Vista/update-a-driver-for-hardware-that-isn ' t-work correctly

    See Run the DirectX Diagnostic tool

    Now for the question of the service pack:

    How you try to install the service pack?

    You can check these links:

    Learn how to install Windows Vista Service Pack 1 (SP1)

    What's included in Windows Vista Service Pack 2 (SP2)

    How to obtain the latest Windows Vista service pack

    It will be useful.

    Please return to the State of the question.

  • Back up and restore the question: system image backup does not show all by backup, but, but still it is there on this disc 'G '.

    Issue of OP - backup and restore

    Hello Forum,

    Recently by doing some interviews I found something strange, almost a week ago, I did a backup image of the system disk. Today, I was looking for the backup image, it seems there is no picture, as you can see on the screenshot attached No.1 he says there are no backups saved to this location, so I clicked on "select another backup...". "but nothing has been found as you can see on the screenshot No. 2, but it is still there on this disc 'G' as selected on the screen n ° 3.

    This image is useless? Shell I have delete and make a new one?

    Answers will be appreciated

    Thank you

    Motiman

    Hi Motiman,

    Thanks for posting your query on the Microsoft community.

    We understand the inconvenience caused and we will try our best to solve the problem.

    This problem may occur if the backup system image files is not created correctly or may be corrupted.

    I suggest you try again to create the system image backup and check if it helps.

    Refer to the following Microsoft Help article, which explains: how to create backup system Image in Windows 7.

    http://Windows.Microsoft.com/en-in/Windows/back-up-programs-system-settings-files#1TC=Windows-7

    For more information about the backup system image and recovery, see the link below:

    http://Windows.Microsoft.com/en-us/Windows/back-up-restore-FAQ#1TC=Windows-7

    It can be useful, we meet with the status of your question. We will be happy to help you.

  • Back to the top button (href = "#") in the masterpage does not

    Hi all

    I inserted a back button at the bottom of the masterpage upward. When you publish the Webhelp, Robohelp changes the path of ' # 'for'...-... " \#". Problably the program tries to adjust the path to the path of the corresponding section (as with a regular link).

    Is there a way to force Robohelp just to keep the href, as it is (other than in one folder to all the themes and the masterpage?

    Robert

    I changed the links in href = "javascript:scrollTo (0,0);" ' now and it works very well.

  • When I try to change the search words in the browser, it goes back to the expression of the typed original and does not accept the change

    "When I try to change the words in firefox search does not accept... g e. I type in the search for"Joe Bloggs"and then try to change her search to search for"Joe Bloggs"Football it trying to connect briefly and then displays the results of the previous search" Joe Bloggs "and added words 'Football' no longer appear in the search bar.

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

  • Trying to enable and disable the scheduled tasks back but becomes "the name of the specified task * does not exist in the system.

    I am trying to create a .bat file that stops a set of scheduled tasks and start another game, but when it works it is said that there is no such thing as the name of the task

    SCHTASKS/Change/disable /TN ImageCopyTest
    ERROR: The name of the specified job 'ImageCopyTest' does not exist in the system.

    Running schtasks/query does not list the tasks that I have implemented in Task Scheduler

    For operational reasons, the tasks are set on "Run If the user is logged in or not ' and I read somewhere that this automatically makes the hidden task

    Can someone shed light on how I can get around what I need this operation for our recovery after disaster

    It's on Windows Server 2008 R2 Enterprise

    Hello

    Apologize for the delay in response. Because the question you posted is related to Windows Server and more complex than that which are usually dealt with here, this issue will be safer in our MSDN forums that cater to the more THIS professional audience.

    Thank you.

  • can you get back from the videos that are live foods and does not store on anywhere they would always hard disk drive somewhere not

    We were broadcasting live online do you know if that would be stored on my hard drive any where... or can they be high anyway... ?

    Sorry, but the live feeds are not saved and cannot not even be found using recovery software because they have not been saved as files.

    I wish I had better news, but they are simply not on the system (unless you have chosen to save them).

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Non-Null Validation step does not work with the hidden field?

    Hello

    I have a field that is a selection list.

    I have another field, which is also a selection list, but which is masked by the dynamic loading of the page Action (if the value of the first field is 'False').

    If the value of the 1st select list is 'True', the 2nd selection list appears and the user must select a value.

    I have created a "Item Not Null" Validation, because I need to force the users to select the value in the 2nd, select list.

    However, the Validation does not work! I guess it's because the 2nd selection list is hidden / display by dynamic action!

    The 2nd selection list is null to display the value 'NULL '.

    How can I solve it please?

    It has nothing to do with the dynamic Action.

    Try to delete "NULL" in the value of the Null display field. Just leave it blank.
    In this case, "specified element is NOT NULL" must be selected in the Validation.

  • After back to Windows 7 from Windows 10, my Windows will not load and everything freezes in safe mode.

    Original title: backup Windows 10 for windows 7

    Hello

    can someone help me please. We have recently upgraded to Windows 10 but didn't like it. Having had the opportunity to go back to Windows 7, I did. Now Windows does not load. When I run the system repair, it works and when you scroll the dialogue it passes all the tests, but said a patch prevents starting windows.

    I tried to go into safe mode, but all crashes and I do not have a slider and it goes to a screen saver.

    I have limited computer please not too technical answers, if you want to see something then please explain to me how do.

    Best regards in anticipation.

    Valo

    Hello

    Thank you for contacting Microsoft Community

    I understand that you are facing the problem with win 10 in SafeMode as normal mode

    Please answer these questions to better understand the issue and help you:

    1. You have the disc of windows 7 installation?

    I want to suggest everything first, disconnect any external devices (Cd/DVD, USB key, webcam, memory card reader, etc.), except the mouse and keyboard and try to start.

    Now press Ctrl + Shift + ESC key combination to check if the Task Manager opens.

    If you have the Windows 7 installation disc, try to run the Startup Repair tool once more with the disc.

    If this does not help, get in safe mode with command prompt and use startup recovery tool to repair windows startup problems

    https://support.Microsoft.com/en-us/KB/927392

    Hope this helps

    Thank you

    Amplifier. Mayank Chadha

  • Store changed from the United Kingdom to China using my old zip code. Now cannot get back. Payment type is NONE, but get requests by charging to add card details.

    Store changed from the United Kingdom to China the other day using my old zip code. Now can not return to the United Kingdom. Payment type is NONE, but get requests in billing add card details that they are not everything. Postal code is changed back to UK. Phone is iOS 4 s 9.2.1. Any ideas how to get back?

    Hi Sandyback,

    Thank you for your participation in the communities of Support from Apple.

    I see that you have changed the country associated with your Apple (iTunes Store account) ID, and now ask you to provide a method of payment. This happens when changing the country on an existing Apple ID, according to why I can't select None when I change my Apple ID payment information?

    If you have changed your country or region

    When you change the country or the region of an Apple ID, you must provide a payment method and update your billing options. If you want to delete your payment method after you change the country or region, you can change your payment information to none.

    You will not be able to see or select the no payment option for one of these reasons. If you don't want to use a credit card, you can use another form of payment, for example, a gift card.

    Sincerely.

  • Taken non-zero indexing in executions

    If the team voted and I have to use non-zero indexing for my test sockets

    I followed the guide to change the index in the batch dialog box

    http://digital.NI.com/public.nsf/allkb/A6D0EF1F4FE5EC94862570AE000CE374

    which is so much more important since I replaced the dialog box. What matters is the name of the executions and they correspond to the physical socket number.

    Here is a more Visual example.

    I noticed the NOTE on the

    How do I Change My Test Socket numbers are not based on the zero?

    Guide.

    Note: This procedure will not change the numbering of the Testsockets in the process template, because it would take more changes emultiple.

    I want to only change taken above executions so they correspond to the socket number no test of zero in the above dialog box. Any help would be appreciated.

    Hey Taylor,

    In order to change the way in which the index is displayed, you can modify the Configure ListBar VI in TS Full LabVIEW UI Dependencies.lvlib . The specific change is to change the string entry in the ExecutionListConnection node property DisplayExpression property. The entry has the default value:

    "%CurrentExecution%\n" + ("%UUTSerialNumber%" == "" ? "" : (ResStr("TSUI_OI_MAIN_PANEL", "SERIAL_NUMBER") + " %UUTSerialNumber%\n")) + ("%TestSocketIndex%" == "" ? "" : ResStr("TSUI_OI_MAIN_PANEL", "SOCKET_NUMBER") + " %TestSocketIndex%\n") + "%ModelState%"

    You can replace this with the following code:

    "%CurrentExecution%\n" + ("%UUTSerialNumber%" == "" ? "" : (ResStr("TSUI_OI_MAIN_PANEL", "SERIAL_NUMBER") + " %UUTSerialNumber%\n")) + ("%TestSocketIndex%" == "" ? "" : ResStr("TSUI_OI_MAIN_PANEL", "SOCKET_NUMBER") + "str(val(%TestSocketIndex%)+1)\n") + "%ModelState%"

    The interest is specifically: "str(val(%TestSocketIndex%)+1)\n" .

    Let me know if you have any questions.

    Best regards,

  • SeaTools-BACK does not detect my hard drive, how I should zero my HDD now?

    Hi all!
    I use SeaTools for DOS for many years to fill the hard drive of my old ancient PC from scratch and never has a problem. However, today when I had zero fill the Momentus ST9500325AS 500 GB SATA laptop 1 year, I got to know that the last SeaTools for DOS can not find a controller to read my hard drive. My laptop has Intel HM67 chipset. As the 'last' SeaTools BACK has been updated in 2011, I understand very well that Seagate does not update the tool to add the controller of my chipset. So all I want to ask is, how do I zero fill my drive now? Should I go for some other tools? Are they reliable? Please suggest some good I knew that nothing else than seatools for zero fill.
    Thank you for your help

    Hi Satyam,

    Formatting zeros is a comprehensive method of wiping a disk storage. When formatting a storage drive deletes data on the surface, the data can still be recovered until it is replaced. Formatting the storage disk wipes zeros, replaces the data deleted by a series of zeros and then wipe the drive again to make recovery of data beyond the civil means. Zeros of formatting is usually done to hard disk drives and flash drives can also benefit from the method.

    We can refer to this article and check if that helps.

    How zeros external drive using DiscWizard: http://knowledge.seagate.com/articles/en_US/FAQ/205971en

    Alternatively, you can also post this question to the Seagate Community Forums: http://forums.seagate.com/

    Response with the State of the question and we will be happy to offer you our help.

Maybe you are looking for

  • Install Windows 8 on HP TS IQ506T

    Hello Has anyone tried to install Windows 8 on HP TouchSmart IQ506t? I bought this all-in-one PC in 2008 and it still runs 64-bit Vista (yuck!). I'm debating between Windows 7 and Windows 8. Who would you recommend? Thank you

  • best tripod for SLT A58

    Hello Can someone please suggest a good tripod for SLT A58? Thank you.

  • I have a home network.

    A computer is a laptop, the other is a desktop computer. Both are running Windows Vista. Both computers are mine and sit when I'm home. I can see the two computers from a computer. I can't that computer access to computer B, but can not access to com

  • CTR upgrading to VMS - when?

    Early December he stated that the application temporary "Cisco threat response" should be replaced with a lite / free (no word on what to call it Cisco) verson of VMS to run only on Windows. Then it had to be late December and now mid-February. Has a

  • Lightroom applying not automatic correction of the lens for M43 objectives

    Forums, there are many discussions about the automatic application of integrated objectives M43 profiles.  My problem is that Lightroom does not apply the profiles of builtin for a camera of the MDGs - em5 olympus (lens panasonic lumix 14-140 3.5 to