I want my procedure to return the error message in the batch file

Hi team,

I have a requirement from users of the company. Could you please provide your suggetsion to achieve this.

We have a batch file that is short on time, in this batch file, I'll call you a SQL script.

In the SQL script, I called you a procedure to run.

Inside the procedure, I have the following statement,

Select, insert and update commands.

and I use ANOTHER exception to handle errors.

My requirement is to pass the error messages for the batch file when one of the orders was not not run and send a notification e-mail to the group with the error text.

Please provide your suggestion.

Thank you and best regards,

Robette.

Could you please tell me, inside the procedure I have to remove the OTHER exception and how I can pass the value to the command file and where I add the content of the e-mail notification.

I suggest that you write modular code instead.

1. create a log table

2 modify the procedure to log on to the error log table or exceptions

3. that others suggest have the recovery/return procedure an exception in the client/batch file

4. for an exception have the batch file to call a procedure to do the emailing if there were exceptions

IMHO, it's a MISTAKE to try to put all these features in a single file. It is NOT scalable and makes it almost impossible to update the batch file if the requirements change in the future.

Logging should be a separate process with a separate log table so that you can capture ALL of the information that may be necessary, now or in the future. Enter information in a table of newspaper, it is EASY for ANYONE to query to see what problems are occurring in the process.

Emailing should be a separate process so that it can be used for your batch file current, files of future orders or even by procedures or functions in the database.

Do not try to create a solution "a script does everything."

Tags: Database

Similar Questions

  • Calling a database procedure which returns the array as output parameters

    Hello


    I wanted to call a procedure that returns "T_Disponibilidad_Diaria".

    Type T_Disponibilidad_Diaria is Table of the R_Disponibilidad_Diaria
    INDEX OF DIRECTORY;


    Type R_Disponibilidad_Diaria is {Record

    }

    Please suggest me the best way to convert this type of array complex java object
    Thanks in advance


    Concerning
    Vidya

    But what you can do...

    Try to create a new stored procedure, which returns the type of the database object.
    In this procedure, you can call the original procedure.
    Take what it returns and make the type object. That's what you need to retrieve your procedure ;-) (.. .huh?)

  • Microsoft Outlook returns an error message.

    Vista using my Microsoft Outlook returns an error message, you cannot start Microsoft Office Outlook. Cannot open the Outlook window.

    Vista using my Microsoft Outlook returns an error message, you cannot start Microsoft Office Outlook. Cannot open the Outlook window.

    Start button > in the search box, type outlook.exe /resetnavpane > press the Enter key.
    Note: there is a space between 'exe' and ' / '.

    t-4-2

  • Error message: "could not cop files. Make sure that the target disk is not dead", during the installation of the drivers scanner Epson Perfection V500.

    Original title: the scanner driver update problems.

    Problem: I am trying to install a driver for an Epson scanner update.  I get the error message: could not copy files.  Make sure that the target disk is not read-only.

    I'm running Windows XP Home edition.  Scanner is an Epson Perfection V500 Photo.

    What I did:

    • A release with the support of Epson.  They tell me that I have the admin rights.  However, I am the administrator and log on as administrator
    • I downloaded the epson driver update, which is an executable zip file.  I right-click on the file, select Run As..., opt to run it as an admin user, enter my password and select run.  The files are decompressed, but at some point in the installation, I get the message "couldn't cop files.  Make sure that the target disk is not read-only.  (Target is C:\)
    • Furthermore, I installed this driver successfully on my other computer that is running Windows XP Professional

    Why not copy the driver files?

    Hi Passport35,

    You can try the following steps and check if it helps.

    Method 1:

    You can try running the fixit article and following cjheck, if it helps.

    Diagnose and solve the program installation and uninstallation problems automatically

    Method 2:

    If the previous step fails then I suggest that scan you SFC on the computer that would be a system file corrupt on the computer search and replace.

    a. click Start, click Run, type cmd in the Open box and then click OK.

    b. at the command prompt, type sfc/scannow, and then press ENTER.

    Note: the scan may take a while, so be patient. Windows allows to fix corrupt or missing files it finds. If the information of the installation CD is required to fix the problem, you may be asked to insert your Windows XP installation CD.

    Wait for the analysis of complete and then check if you can install the drivers.

  • LR has started to refuse to import my photos from sd card. They appear in the display of the grid, all verified and ready to import, but I get the error messages. 'Cannot read file', (it of funny, since LR is SHOWING files full resolution), or "unable to

    Cannot import photos into LR. On my other computer, it works fine. With the help of LRCC 2015. Get the error message can't read files, or can not copy to the location.

    How can I simply wipe the slate clean and reinstall or re-import everything? I'm really happy with this, as I am now prevented from using the program.

    Can I reinstall LR and keep the catalog?

    Hello

    Please check what is the Destination defined in the right panel in the import window

    The error means the destination that you copy the files to is invalid or read-only.

    Change the Destination to another location and see if you can import

    Concerning

    Assani

  • File filter errors in the batch file

    Hi all.

    I can't filter element in the home folder of batch file.

    File is very long number.

    error1.png

    When you use the batch file filter item. Filter by folder

    error2.png

    Filter file is intger but real record is long.

    Thanks for your suggestions.

    Hoan

    Hi Hoan,

    Bug 17919457 : MANAGER of REPO THROWS WARNING WHEN RECORDS DCOLLECTIONID EXCEEDS the ENTIRE VALUE of MAX

    Try searching for it in support of oracle. You will get the solution to your problem.

    -Prashant

  • I just tried to update Firefox to version 9.0.1. Extract of 13%, and then I got an error message cannot open output file. Can you help me please?

    I just tried to update Firefox to version 9.0.1. Extract of 13%, and then I got the error message cannot open output file.

    The file can be uploaded incorrectly. Could you it redownload again from http://getfirefox.com?

  • Why not be able to run MRT.exe using the batch file?

    When I run the following script using the batch file, MRT cannot be run.

    Does anyone have any suggestions?

    Thanks in advance for your suggestions

    off @echo
    C:\WINDOWS\system32\Mrt.exe/q/f

    Hello

    ·         The computer is connected to a domain network?

    ·         What is the error you get when trying to execute the batch file?

    If the computer is connected to a domain network, I suggest you to report this issue in Windows XP IT Pro Forums: http://social.technet.microsoft.com/Forums/en-US/category/windowsxpitpro

    Thank you.

  • How to adjust the volume to specific levels by using the batch file?

    I use Windows Media player and want to adjust the volume level automatically using planning.

    Anyone have any suggestions on how to set the volume level by using the batch file?

    such that 0 is mute and 10 max, I want to set the volume 4

    Thanks in advance for your suggestions

    Eric

    Hi Eric,.

    The question you have posted is better suited to the MSDN forums. You can ask your question in the help link.

    http://social.msdn.Microsoft.com/forums/en-us/categories

    Hope the helps of information.

  • Automatic execution of commands in the batch file

    When the batch file containing the following commands is executed, orders of the line 1, 2, and 3 are executed, but the 'TIME' command is executed after that I closed the "EXCEL." I want the command 'TIME' to be run automatically without needing to close the 'EXCEL '. Could you please suggest a way to do it.

    CLS

    TASKKILL /IM "" EXCEL. "." "EXE" / F

    C:\PROGRA~1\MICROS~2\Office14\EXCEL. EXE

    TIME

    The code must be in the following form:

    CLS

    TASKKILL /IM "" EXCEL. "." "EXE" / F

    Start/b C:\Progra~1\Micros~2\Office14\EXCEL. EXE

    TIME

  • How to kill the Batch files

    Hello

    I have three files batch for the aggregation.

    I used maxL in the batch file, and there are nearly 10 scripts of aggregation.

    Sometimes I have to kill the batch files... Can anyone please suggest how to kill the ball file while running.


    Thanks in advance.

    Depends on who do OS you run the script, you run the script and why you want to kill the script
    The script can be killed, but this does not mean that the current operation of essbase, you may need to use maxl /eas to try to kill the active session/query.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • How to upgrade a driver automatically in Windows NT by using the batch file

    I use the devcon tool to update a Windows XP driver, but unfortunately it does not support Windows NT. So I'm looking for a similar tool for Windows NT. Does anyone know any tool / or script that would update a driver via file/command line in Windows NT?

    Thank you for taking the time to read the question.

    Hello supportalcon,

    Thank you for the question!

    It is disheartening to know that have problems you with the Windows Driver. As I understand it, you need to update a driver automatically in Windows NT by using the batch file.

    The question you posted would be better suited in the MSDN Forums. I would recommend posting your query in the MSDN Forums. You can follow the link to your question:

    http://social.msdn.Microsoft.com/forums/en-us/categories/

    Meet us if you face any problem of Windows, and I'd be happy to help you again and try to correct the problem as soon as possible.

    Good day!

    Hope this information helps.

  • To open Internet Explorer as a background process in the batch file

    I need to write the batch file, which will open Internet explore it as a background service/mode (which you don't mind the user).

    Thanks in advance

    Paritosh

    Hi Paritosh,

    The question you have posted is better suited to the MSDN forums. You can ask your question in the help link.

    http://social.msdn.Microsoft.com/forums/en-us/categories

    Hope the helps of information.

  • Automatic execution of the batch file at the connection of the USB drive

    I created a batch file that checks the drive e. the presence of a specific file, and if there, copy it to a location on the hard drive. (Drive E is where all USB drives see the place through my window of Windows Explorer.) I would like to set up my computer so that this batch file is executed whenever such a device is plugged into the USB port. How can I accomplish that?

    Otherwise, is it possible to incorporate the Attaché-USB-player status in the batch file itself and just leave that batch file running at any time? I used "IF EXISTS E:\*.*", but that is not do me much good, because I have to keep control of this condition again and again, and eventually the batch file gets tired of the audit and said that the drive does not exist.

    Hello

    You can ask your question on the TechNet forums for batch files.

    http://social.technet.Microsoft.com/forums/en-us/category/windowsvistaitpro

  • Simple two program start and kill the Batch file

    Hello all :)

    (Today) I am new to the script of the machine. It is something that I put in place and will try tomorrow.

    CD /d "C:\path".
    Debut.bat

    CD /d "H:\path".
    Beginning Program.exe

    : CHECK
    ping localhost 10 1 n > ZERO
    AV TASKLIST /fi "IMAGENAME eq program.exe" 2 > & 1 > NULL
    IF ERRORLEVEL 1 GOTO CHECK

    Taskkill /f /im cmd.exe/t

    If all goes well, .bat runs. A program will be executed. CMD will then search for program.exe until not found (released), then close the CMD.

    In this case program.exe does not work with start/wait

    I wonder if the check will slow down my machine if worked for a few hours.

    I use Windows 7 x 64, SSD, 16 GB RAM and AMD 8350.

    Considering the insertion of a small time-out, but seems ridiculous.

    Is there a way to slow down the check, but always close immediately if program.exe is closed? Other alternatives? Thanks :)

    The original manuscript of lots above is more suited for a loop that could sleep until needed, thus reducing CPU cycles

    -> You can easily find it by yourself:
    1. launch the batch file

    2. start the Task Manager.

    3. click on the performance tab.

    4. Add the "CPU Time" column.

    5. sort the list next to the name of the task.

    6. take note of the time CPU for cmd.exe.

    7. check once again the batch file run for an hour.

    I bet that time CPU will be negligible. I expect the timeout function to be very frugal. Tasklist.exe takes more time, but it runs only once every 20 seconds.

Maybe you are looking for

  • change the name of the step within a sous-suite

    Hello I have a 'major' sequence and a sous-suite 'test '. Main test calls sous-séquence. The 'disable tracking in order' is active on the sequence of 'test '. During the execution of the principal I will not see what is happening in the subsequence '

  • HP ENVY 17: Can I put my graphics

    I'm not very good with computer harware and know what are the components, but I was wondering if it was possible to upgrade all aspects of my pc to give me a little more FPS in the high end games able to manage my laptop on medium setting well enough

  • HP 250 G2 (intel i3)

    Hi, I own a Hp 250 G2 running windows 7 ultimate 64-bit. Recently, I have formatted and and I reinstalled all the drivers from hp for this product support page. But im having trouble finding the driver for an "unknown device" which seem to be a PCI d

  • No speakers on computer does not, but the head phones are for HP Pavilion Dv7

    The speakers on my Hp Pavilion DV7 - 3164cl have stopped working. The only time sound works when I use headphones or connect the computer to my tv. I have already uninstalled and reinstalled the IDT High Definition Audio Codec (Version 6.1.6345.0 dri

  • OSCDIMG

    Question 1: "OSCDIMG can create image ISO BOOTABLE for OS to WIN7, WIN8, WIN8.1..., because they have the etfsboot.com boot loader.But if I want to create an ISO image BOOTABLE from ANY physical CD BOOTABLE (for example a game cd), so I can't use OSC