Spool Error capture question

Hi,
I am trying to spool data from tables into flat files. I am using the following scripts to accomplish it
1. A cmd file (windows) that makes a call to a sql file
2. The SQL file which generates another query file at the run time, depending upon the table name passed to it
3. The run time query file , that executes the final query and spools the data into a txt file | delimited
For eg:
Actual command passed C:\Spool_utility\spool_utility TABLE_NAME
Eg of the spool utility file :
@echo off
SET dbuser=XX@YY
SET dbpw=xxxx
echo %date% - %time% - Start > %1%log.txt
echo START
sqlplus -s %dbuser%/%dbpw% @spool_utility.sql %1>%1.txt
echo %date% - %time% - Done >> %1%log.txt
echo DONE
Eg of the spool_utility.sql
set echo off
SET newpage 0
SET feedback off
SET linesize 32767
set pagesize 0
SET wrap off
SET recsep off
SET con off
SET trim on
SET trims on
set verify off
SET doc off
SET termout off
SET arraysize 5000
SET HEADING off
set colsep "|"
spool &1.sql;
Prompt Select * from &1 where some condition
spool off
set termout ON
@ &1
EXIT
The above file generates a table_name.sql file with the actual table name at run time and gets executed and the output is written to the table_name.txt file.
This works perfectly fine. But the issue is when someone passes some wrong table name or if there is a actual run time error while executing the query , the error with details itself itself gets written to the end spool file.
For eg : if i do this just to generate an error and execute it from command line, the query generates an error and writes the error to the spool file , but at the command prompt where I executed the command I do not see any error and the process seems to have run perfectly well
set xxx on xxx off as above
spool &1.sql;
Prompt Select * from &1 where rownum><10---this will cause the issue
spool off
set termout ON
@ &1
EXIT
Eg of spool file generated :
from     table_name WHERE rownum><=10 *
ERROR at line 62:
ORA-00936: missing expression
My question is, is there any way i can capture this runtime error and return this error to my calling sql script spool_utility.sql and then propagate it to the calling command file and do some tasks for eg removing the spool file and writing the actual error to a log file . Basically any way to know at my OS calling level that the entire spooling operation was unsuccessful.
Thanks

Thanks for the reply.
Querying the data dictionary will work only when the issue is a invalid table name. My question is can i capture any run time error, not only incorrect table name.
If there is any run time error (for eg the one I showed where I used a >< sign which is a invalid operator) the error gets written to my spool file, but there is no way I am able to capture that in my calling sql script and subsequently in the calling command file so that I can do something with the error. For eg if a spool file may get written with error messages, some batch process or user may pick up the spool file and start processing which i dont want to happen. i would like to trap that error or at least be notified of the error at my outer calling sql file or outer command file level, so that I can write the error to a log file and delete the erroneous spool file etc.

Similar Messages

  • Spool Error Monitoring through CCMS not available in Standard Delivered MTE

    Hi Everyone,
    My Client requirement is to monitor SPOOL Errors through CCMS. But Standard Monitoring Tree Elements (MTEs) does not capture the Spool Errors .
    Can anybody Please let me know , How Can I setup Spool Error Monitoring through CCMS.
    Thanks & Regards
    Deepak Gosain

    Deepak,
    Check this One...
    //help.sap.com/saphelp_nw70/helpdata/en/34/658a3b15566262e10000000a11402f/content.htm]
    Hope this Helps....
    Happy Learning
    Chander N Purna

  • Error while printing (SAP spool error)

    Hi,
    I have configured a printer of type 'C : Direct Operating System Call'. On printing a page, an error occurs with the following log entries
    SAP spool error log
    =====================
    Print request processing log
    The host spool is reporting errors
    Windows/NT error 1775: "A null context handle was passed from the client to the host during a remote procedure call."
    Errors occurred processing this print request
    Error during print request output. l_rc = 1
    There may be no printout
    Please. can someone help me out here.
    Thanks!
    Regards,
    Angad

    Ok I am upgrading from R/3 46C to ECC 6.0, on the 46c system the printers are configured as follow:
    Device type          HPLJ4    : HP Laserjet 4 series
    Spool server          sapprod1_PRD_00       sapprod1
    Device class          Standard printer
    Host spool access method C: Direct operating system call
    Host printer          
    srtroot03.startek.com\srt-dc-c4-sharp
    Host name          sapprod1
    On the ECC 6.0 system the printers are configured as follows:
    Device Type          HPLJ4    : HP Laserjet 4 series
    Spool Server          srtsapeccdev1_DEV_00
    Server Description
    Host               srtsapeccdev1
    Device Class          Standard printer
    Host Spool Access Method C: Direct operating system call
    Host printer          
    srtroot03.startek.co\srt-dc-c4-sharp
    HostName          srtsapeccdev1
    The 46c system prints just fine, on the ECC 6.0 systems; I can not get the printers to work.  I have made sure that the hosts file on the ECC server has the printer host address, and I get the following error back:
    SAP spool error log
    =====================                                                     
    Print request processing log
    The host spool is reporting errors
    Windows/NT error 5 [
    srtroot03.startek.com\srt-dc-c4-sharp]: "Access is denied."
    Errors occurred processing this print request
    Error during print request output. l_rc = 1
    There may be no printout
    The access to the Printer Host is wide open, what do I need to do to resolve this issue.

  • Spool Error - Errors occurred processing this print request

    Hi,
          I have a problem printing documents through spool.
    1. I run a form from Form Builder, execute and select to print from spool
    2. In SP02, I select the spool request created and Select Direct Printing.
    Spool request Status is changed to error and following is the error log.
    I get this for all print requests from spool. When I print these documents directly, I have no problem. I understand there is some problem with the spool server but do not know what it is.
    I also observed that when the spool access method is G - I have no problems in printing.
    Printer: HP HP laserJet PS (2430)
    Host Spool Access Method: L: Print Locally Using LP/LPR.
    Device Class: Standard Printer.
    SAP NW 2004s SP14
          SAP spool error log
          =====================
    Print request processing log
    The host spool is reporting errors
    Message from host spool:
      D:\usr\sap\BS9\DVEBMGS00\data\000001615100001.BS9 is currently being printed
    End of message
    Command used: print /d:
    bs107.platinumdb.com\HP01 D:\usr\sap\BS9\DVEBMGS00\data\000001615100001.BS9
    Errors occurred processing this print request
    Error during print request output. l_rc = 1
    There may be no printout
    Most important attributes of spool request
    Request number 16151
    Request name PBFORM HP01 SMULLAPUDI
    Client 800
    Owner SMULLAPUDI
    Request attributes
    Time created   2008050118454600
    Remaining life  +00007235918
    Dispo 1 (Go/Hold) H
    Dispo 2 (Keep/Delete)     K
    Dispo 3 (Indirect/Direct) D
    Default output device HP01
    Default no. copies  1
    Format G_RAW
    Main print request characteristics
    Spool request number 16151
    Print request number 1
    Print request attributes
    Time created   2008050118471500
    Output device HP01
    Format G_RAW
    Character converter active when first problem occurred
    No information available
    I am working on this since 4 days with  no solution. Kindly help.
    Thank you,
    Vasu
    Edited by: subbu M on May 2, 2008 11:37 PM

    Hi Sri,
    Try to setup the printer at OS LEVEL.
    then,
    If on Windows---use method C.
    if not,
    use method U and map to your printer queue at OS level.
    Hope this resloves this issue.
    Reward Pts if useful
    Regards,
    Malti

  • Is there a custom function available which can be used for logging errors captured in a sp in a sql table

    Is there a custom function  available which can be used for logging errors captured in a sp during and after execution in a sql table?
    Basically we  would like to utilize such function  in every sp and log errors of each sp in a error log table
    Mudassar

    Thanks .
    I was able to write this however I am thinking I am missing something
    CREATE FUNCTION testfunction1()
    RETURNS @temp_error TABLE (
    id int identity(1,1),
    procedure_name varchar(255),
    line_number int,
    error_number int,
    error_message varchar(max),
    error_state int,
    error_severity int,
    occurence_datetime datetime default current_timestamp,
    user_name sysname default suser_name(),
    login_name sysname default suser_name()
    AS
    BEGIN
    insert @temp_error(procedure_name,line_number,error_number,error_message,error_state,error_severity)
    select error_procedure(),error_line(),error_number(),error_message(),error_state(),error_severity()
    RETURN;
    END;
    CREATE TYPE test_type AS TABLE(
    id int identity(1,1),
    procedure_name varchar(255),
    line_number int,
    error_number int,
    error_message varchar(max),
    error_state int,
    error_severity int,
    occurence_datetime datetime default current_timestamp,
    user_name sysname default suser_name(),
    login_name sysname default suser_name()
    GO
    create proc usp_error_test
    @test_type AS test_type READONLY
    as
    begin
    begin try
    select 1/0
    end try
    begin catch
    select * from testfunction1(@test_type)
    end catch
    end
    Mudassar

  • Acrobat Pro form getting MAPI spooler error

    I have a form created in Acrobat Pro. The users are using Reader 9.3.1. When the user clicks the Submit button, they get a MAPI Spooler error. For some Windows Services closes Reader. Any thoughts on what is causing this and how to fix?
    Thanks,
    MDawn

    Hi Lon ,
    I would request you to get in touch with the support team to get your issue fixed.
    http://helpx.adobe.com/x-productkb/global/service-b.html
    Regards
    Sukrit Dhingra

  • Print spooler error 0x800706b9

    I have a Microsoft Windows 8.1 and an HP Desktop 2512.  My computer no longer recognizes my printer. I keep receiveing a print spooler error 0x800706b9  I have tried the net start spooler command but that has been unsuccessful. What next? Please help!

    Hey , Welcome to the HP Support Forums!
    I understand that you are no longer able to print from your Windows 8.1 computer to your HP Deskjet 2512 All-in-One Printer as your computer is reporting a 'Print Spooler Error: 0x800706b9'. I would like to assist you today with resolving this Print Spooler error. Now, just so you are aware, the Print Spooler is a feature of your Operating System. It is built into your Windows computer. Essentially, it is the print system built into your computer. Printers rely on the Print Spooler to be functioning in order to print. The Spooler is not specific to HP. Therefore, I will be able to offer you some standard computer troubleshooting steps. However, should the issue persist you may need to speak with Microsoft Support or the manufacturer of your computer to resolve this Operating System issue. With that being said, can I please have you follow the steps below to resolve this issue.  Step 1: Check Print Spooler: Open your Start screen by selecting the Windows button on the bottom left hand side of your computer screen or by selecting the Windows key on the bottom left of your keyboard, to the right of the Ctrl buttonIn the Start screen type RunClick on Run to launch the Run dialogue boxIn the Run box type services.msc and select OKWhen the Services window opens scroll down until you see Print SpoolerClick on Print Spooler once just to highlight itIf you see Start in the top left hand corner than that indicates that  your Print Spooler is in fact Stopped (not good). But we will leave this for now.If you see Stop or Restart in the top left hand corner than this indicates that your Print Spooler is actually Started. Please click on Stop to temporarily Stop the service.Minimize this window as we will  need to come back here Step 2: Check Spooler Folder: Reopen your Start screenType Computer. Click on Computer (or This PC) when it populates as a resultIn the Computer window select your C DriveClick on WindowsClick System32Click SpoolClick PRINTERS. You may get a permissions warning, just Continue past this.The PRINTERS folder should be empty. If there is any files in here they are corrupted print jobs. Right click on anything in this folder and 'delete' the files.Close the PRINTERS folder Step 3: Start Spooler and Check Dependencies:  1. Reopen the Services window we previously minimized 2. Click on Print Spooler again to highlight it 3. Click on Start in the top left corner 4. If you get an error message please take note of it 5. If the Print Spooler starts successfully you will see 'Stop and Restart' as your options in the top left 6. Next, double left click on Print Spooler. A Print Spooler Properties window will now open. Click on the Log On tab at the top. Can you please make sure this is set to Local System Account and make sure the box is checked to 'Allow Service to Interact with Desktop'. 7. Next, click on the 'Dependencies' tab. Please check what Dependencies are listed. I will need to know this should the issue persist once you complete the steps I'm providing in this post.   8. Click Apply and OK for any changes you may have made under the Log On tab. Close the Services window.  Once the Print Spooler Service has started successfully you should be able to access your HP Deskjet under the Devices and Printers folder on your Windows 8.1 computer. You should also be able to print. Can I please have you test printing at this point to confirm that the Print Spooler error has been resolved. Please respond to this post with the result of your troubleshooting. I look forward to hearing from you. Best of luck!

  • Getting spool error when trying to use a network printer from a remote computer.

    I have 2 HP deskjet printers attached to my computer.  One is a D4260 and the 2nd is an F4280 all in one.  I would like both of these printers to be available on our wireless network so that my girlfriend can use the printers from her laptop. The D4260 is working just fine but when I try to print to the all in one it looks as if it printed on her computer but I get a spooling error on mine and no printing.

    Go to hp.com.au, top right corner select support & drivers
    select software & driver download type in your printer name HP Deskjet F4280
    then select your operating system-step 1
    on step 2 select utility diagnostic tools,select HP Print Diagnostic Utility
    run the software, select your printer, then diagnose...then select fix all
    this software automatically detects spooler errors & fix them
    just follow the instructions from the HP Print Diagnostic Utility
    good luck.
    Although I am working on behalf of HP, I am speaking for myself and not for HP.
    Love Kudos! If you feel my post has helped you please click the White Kudos! Star just below my name : )
    If you feel my answer has fixed your problem please click 'Mark As Solution' and make it easier for others to find help quickly : )
    Happy Troubleshooting : )

  • Capturing Question #1

    Hi. I have two capturing questions that I could really use some help with, I'll keep them seperate.
    Since downloading the new FCP update I have had a new warning before capturing and I can't figure out what I'm supposed to do about it. Quoted as follows:
    WARNING: You are about to capture drop-frame media to a non
    drop-frame clip. If you proceed, you may experience changes in
    logged in and out points, problems relinking media, or removal of
    master clip relationships.
    Cancel OK
    I just don't know as much as I should about this stuff. Not even what other info you guys might need. I'm capturing Firewire from a Sony TRV-22 to a 250GB external LaCie.
    Thanks,
    Ariel.
    Dual 2.3 GHz PowerPC G5   Mac OS X (10.4.7)   FCP 5.1.2, QT 7.1.3, 2 GB DDR2 SDRAM

    The difference is in the TIMECODE. Somehow you have a batch of clips that have been logged with NON-DROP timecode...the : separators are all colons ":" that indicate that the footage logged was NDF TC. Drop frame separators look the same, but the last one is a SEMI colon ";" indicating drop frame code.
    Re-log that tape and you should be good to go.
    Shane

  • How to monitor Spool errors/Spool request in CCMS

    Hi @ all,
    I have configured our Solution Manager system to monitor the spool system in the CCMS environment. However I also want to monitor spool errors/spool request in the *CCMS. I have already search in SDN for a solution but couldn´t find any. Do you have any idea how I could monitor the spool errors in CCMS (like in the transaction SP01) ?
    Kind regards
    Thomas

    Hi
    Have you checked this [http://help.sap.com/saphelp_nw04/helpdata/en/18/2625c6fed011d18e410000e83dd9fc/content.htm|http://help.sap.com/saphelp_nw04/helpdata/en/18/2625c6fed011d18e410000e83dd9fc/content.htm]
    [http://help.sap.com/saphelp_47x200/helpdata/en/34/658a3b15566262e10000000a11402f/frameset.htm|http://help.sap.com/saphelp_47x200/helpdata/en/34/658a3b15566262e10000000a11402f/frameset.htm]
    Jansi

  • Spool error for background job

    Hi All,
    I have scheduled one job in sap for a report.I have made a distribution list via tcode SO01.
    I have given this distribution list to the SPOOL RECEPIENT section in SM 36.
    The job is running successfully but is giving the following error and not sending emails to the distribution list.
    The error is :-
    "Spool list of step 1 could not be sent due to error 7".
    Does anybody has any idea about this error?
    Please help its a production issue.
    Thanks in advance
    Vivekanand Meghmala

    Look at SAP note : 760838
    Symptom
    Background job spool lists are not sent.
    Other terms
    RSBTCRTE, RSPO_SPOOLJOB_TO_OFFICE, SO_DOCUMENT_SEND_API1
    Reason and Prerequisites
    1. The jobs in question have recipient references in table TBTCO but these have no equivalent in the Business Object Repository.
    2. An error occurs when sending in the spool or in the Sapconnect layer.
    Solution
    This note does not provide a direct solution to the problem but it does provide a source code enhancement that you can use to create more trace information about the cause of the error. When you copy and execute a job with spool list recipients, trace messages are output when errors occur.
    After implementing the correction instructions, use transaction SE91 to create the following message:
    Message class: BT
    Number: 347
    Text: Spool list of step &1 could not be sent due to error &2.
    In detail, the error numbers mean:
    1 = Spool request does not exist (or no longer exists)
    2 = Spool request does not contain any data
    3 = Empty page area selected
    4 = No authorization to send the request
    5 = Access to the spool request is not possible
    6 = Read error in the Temse layer
    7 = Spool request could not be sent (sending problem)
    8 = Incorrect request type
    9 = Other

  • Drop-Frame vs. Non-Drop-Frame Capture question

    Hi,
    I'm using Final Cut Pro 5 capturing 16:9 anamorphic video and removing an advanced 24 frame pulldown from my Canon XL-2. This is for a documentary for which I have captured over 30 full tapes of footage. I've been logging in the clips FIRST, then going back and batch capturing everything afterwards.
    My question is this: I have logged everything the same way with seemingly all the same settings. However, when I capture some tapes I get the warning that I'm capturing Non-Drop frame media to a Drop-Frame clip and it could cause problems in the future with relinking. Then some tapes don't give me that message at all. Is there something I'm not noticing about how I log some tapes but not others? Would it have to do with the presets I have Final Cut set to when I'm capturing a tape? I'm fairly positive I've always setup FCP to the proper capture settings before logging anything...but could something else be causing this? Thanks for your help.
    -JD

    The thing to watch out for, both in logging and in capturing, is when you log or capture multiple tapes with mixed NDF & DF timecode.
    There are three or four things that can affect this:
    FCP5 and later allow you to set the TC format of the capture preset, such that the Log & Capture window would default to NDF if you are working with NDF tapes.
    Otherwise, Log & Capture will still auto-detect during playback when logging, but you have to be sure to play the tape some before logging the clip. If you capture multiple tapes using capture now, You could easily start recording before the time code format updates. This kind of error results in a clip whose in point is the correct "number", but the format is wrong.
    During Batch Capture, the device control is not always able to change the time code format. I'm not sure about FCP6, but I am in the habit of grouping my clips in batches according to the TC format. You ma be seeing this alert because you are switching the TC format of the tapes in the batch capture, but device control is "stuck" in DF mode, for instance. This is not an issue during logging, only capture.
    I think it may also be possible to override the clip's logged TC format at capture by unchecking "use logged clip settings".
    Capturing clips with the wrong TC format can really mess up recapture later. The offset that happens as the format gets converted back increases as the starting hour of the timecode gets bigger.
    So basically you can have clips that get logged wrong, and clips that were logged correctly, but captured with the wrong TC. It's easier to miss it when logging, since there's no alert message to pop up. But the other alert is there to tell you there is a mismatch somewhere, preventing you from making the second kind of error. Your only error may only be that you had both DF and NDF clips in the same batch.
    There is a trick to get the TC format to switch to the non-default for batch capture - Open Log & Capture and play the tape until you see the TC format update. Now start the batch capture with Log & Capture still open - device control will stay in that TC format now. Otherwise, I think device control switches to the format of the first clip in the batch, but stays there until you cancel and start a new batch.
    Hope this helps -
    Max Average

  • Spooler error message

    Hi,
    product_name : HP Deskjet F4280 All-in-One Printer
    problem area : error messages
    operating system : Microsoft Windows XP Home
    connected to PC by USB Cable
    wireless internet connection via BT home hub
    problem description : I have a new laptop - Toshiba L350-277 satellite running Windows 7 home premium (32 bit) which I have networked on a wireless connection with my desktop PC (details above) via a BT home hub.
    I have enabled printer sharing but when I try to print from the laptop I get an error message on the desktop as follows:-
    "SPOOLER SUBSYSTEM APP
    SPOOLER SUBSYSTEM APP HAS ENCOUNTERED A PROBLEM AND NEEDS TO CLOSE. WE ARE SORRY FOR THE INCONVENIENCE."
    etc.
    The printer works fine direct from desktop
    This question was solved.
    View Solution.

    This relpy is not helpful. Please point us to where you found the solution rather than leave us hanging. Thank you.

  • FCP5 Error capturing DV

    Hi all
    2 brand new Power mac G5's and FCP 5 arrived at work this morning, woop!
    I've opened one so far.. Fully updated everything.... Tried out FCP and it won't capture!
    This is what I get:
    Logging is fine, and the machine control is too (Sony DSR11) but when it comes to do a batch digitise I get after the first clip "File error: Unknown file". And the same when I try caturing on the fly.
    Thought it may be a prob with the scratch disk being in the boot disk, then added a Lacie Firewire on FW800, still no change (yes I changed the scratch disks to this). Tried both apple firewire and basic firewire but still the same... Oh poo!

    Read this article
    Questions?
    Capturing to your system disk is never advised. Use Firewire not Firewire Basic.
    cheers
    x
    also - Is the search function broken? There are at least 3 other posts on the first page of this forum right now that all ask the same question regarding capturing...

  • Report Generation Toolkit Error Quick Question

    Hi,
         I created the most awesome LabVIEW report ever at my desk using a trial version of the RGT and Office 2003.  I took this to my production machine and ")@#(&%(*#^%()^!!!"  The production machine has office 2007 and a fully licensed version of the RGT.  Both machines have LabVIEW 8.6.0.  I've read all the stuff about these errors and something about classes and dll's and whatnot's.  So my quick question, is:  Instead of matching the versions of Microsoft Office as recommended, can I just rewrite from scratch the VI that creates this world's most awesome LabVIEW report on the production machine to create the same effect? 
    Solved!
    Go to Solution.

    Hi 
    Quick Answer: Probably
    Slower answer: Microsoft changed a lot of things behind the scenes in Office 2007, but the Report Generation toolkit version 1.1.3 supports Office 2007 so you should be good to go. Depends on what functions are included in your VI. Liek the read me says "Several default settings in Microsoft Office 2007 differ slightly from previous versions. Reports you generate using Office 2007 might look different than reports you generate from other versions of Office because font sizes, cell sizes, and so on, differ."
    Best Regards
    David
    NISW

Maybe you are looking for

  • Excise Details are not maintanied for Vendor 0000000957.

    Hi,   As per our regular process  we are capturing inovie with J1IEX  and doing GR in MB01   now i have captured  invoice in J1IEX  and while making GR with MIGO i am getting error Excise Details are not maintanied for Vendor 0000000957. ,  but when

  • Forms-Reports Web : Direct print a file to a local printer

    <p>For those people who are searching a solution to print their PDF Reports from the AS to a chosen local printer, let see this great Direct Print Java Bean from Casey Bowden.</p> Francois

  • How to find the list of material variant based on the characteristics value

    Hi We are creating materials variants for FERT Material Type in material master in MRP-3 view .There we configure the variant by attaching characteristics value  Now we want to have a report , which can give the list of material variants , if char va

  • HOW TO USE BAPI IN FUNCTION MODULE

    Hi All, I am writing BDC for f-28 in that inbetween bdc  i wanted to call a bapi and wated to display that to the endusr and ask user to select line iems from that and then proced the bdc further bsed on that selection PL Sugeest me Somthing Pts assu

  • Renting or Buying

    I have noticed that when renting a movie you are given a choice of Standard or HD but, if buying there are no options. I assume that if there is an HD version available then that's the one you get. Is this correct?