Spooling issue

I have a sql to spool records.But when I execute this the spool file test.log is having a size of 1k even though
It doesnt contain any records .I want the size of log to be 0 k if no records in it.Any set option can I use to overcome this??
set pagesize 0;
set linesize 100;
set colsep '';
set feedback off;
set term off;
spool tes.log;
select distinct aa.user_id, letter_doc_name from temp_mc_letters aa,
(select distinct user_id, decode(user_id2, null,'not found','99', 'not found','found') found_status
from temp_mc_letters ) a,
(select user_id from
  (select distinct user_id, decode(user_id2, null,'not found','99', 'not found','found') found_status
from temp_mc_letters)
group by user_id
having count(9)=1
)                       b
where aa.user_id=a.user_id
  and aa.user_id=b.user_id
  and a.found_status='not found';
spool off;-Hena

It will work if you run it inside a script:
C:\TEMP>dir
Volume in drive C has no label.
Volume Serial Number is 2450-CE06
Directory of C:\TEMP
05/04/2010  03:43 PM    <DIR>          .
05/04/2010  03:43 PM    <DIR>          ..
05/04/2010  03:42 PM               187 test.sql
               1 File(s)            187 bytes
               2 Dir(s)  103,568,400,384 bytes free
C:\TEMP>type test.sql
set pagesize 0;
set linesize 100;
set colsep '';
set feedback off;
set term off;
spool test.log;
select * from scott.emp e, scott.dept d where e.deptno = d.deptno;
spool off
C:\TEMP>
C:\TEMP>
C:\TEMP>
C:\TEMP>sqlplus scott/tiger
SQL*Plus: Release 10.2.0.4.0 - Production on Tue May 4 15:44:24 2010
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
scott@PTS>@test.sql
scott@PTS>host dir test.log
Volume in drive C has no label.
Volume Serial Number is 2450-CE06
Directory of C:\TEMP
05/04/2010  03:44 PM             1,762 test.log   <--  actually contains data
               1 File(s)          1,762 bytes
               0 Dir(s)  103,568,330,752 bytes free
scott@PTS>host vi test.sql
scott@PTS>host type test.sql
set pagesize 0;
set linesize 100;
set colsep '';
set feedback off;
set term off;
spool test.log;
select * from scott.emp e, scott.dept d where e.deptno = d.deptno and 1=2; -- so it doesn't return data
spool off
scott@PTS>@test.sql
scott@PTS>host dir test.log
Volume in drive C has no label.
Volume Serial Number is 2450-CE06
Directory of C:\TEMP
05/04/2010  03:48 PM                 0 test.log
               1 File(s)              0 bytes
               0 Dir(s)  103,568,089,088 bytes free

Similar Messages

  • Report - Spool Issue

    Hi Experts,
    I am working on a Report. When I run Report  at background,Once the Job gets over two spool lists are generated.
    Its like one pool is original and other is like Duplicate one, but the Output remains the same except the one wich has date inthe HEADER of the spool list and other without that date in the other spool list.
    Please help me on this issue.
    Regards,
    Vishwa

    Harish,
    Actually some restriction are made in the Basic level, so that I cant change the Batch system field at foreground and test in Dialog process.
    Regards,
    Vishwa

  • Printer spool issue with HP LaserJet 1018

    I seem to be having a recurring problem with the HP LaserJet 1018 that I am hoping someone has also had and can help me resolve.  When I go to print I get a message that I need to set up a printer (it does not recognize the printer is there).  When I click on set up a new printer, I receive a message that the local print spooler service is not running.  Nothing I do seems to solve the problem. 
    This happened to me with my previous 1018 printer.  The exact same thing.  I had a second 1018 available to me that I connected and it worked just fine for about two months and now is doing the same thing as the first.  
    I have an HP Pavilion Entertainment PC with Windows 7 (64 bit) operating system.  I previously had a Dell with Windows XP that the first printer worked on for a long time (maybe 2+ years).  I got this new computer within the past six months and both these printers stopped working while on this computer.
    Any help or ideas would be appreciated. 

    Welcome to the HP Forums  fastndfury,
    I see by your post that you are only getting the error on the Windows 8 computer, "The scanner is currently in use. Please wait until your previous task is completed and then try scanning again." I can help you with this issue.
    I have provided a document to go through the steps to see if it will help resolve this issue.
    'Another program has control of the scanner' Message Displays on the Computer When Scanning.
    If you need further assistance, let me know.
    Have a nice day!
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Local printer management --Spooler Issues--

    Trouble: of the 3 production printers on a local machine 1 to many of the printers may have a Job get stuck in printing for some unknown issue. Clicking cancel job / Delete fails to remove the Job from the List. At this point i am forced to Kill the Print
    Spooler and restart it.
    Want to have From Wscript.Shell or VBS: for each printer with a Que Count >1 Find the First JobId with a bad status delete this and Copy the remainder of the PrintQue content to a Local "Temp" location use a CancelAllJobs() method, then Replace
    all the Content back into the printer Spooler for re-issue.
    Thoughts?
    Thanks

    I would investigate the root cause of why certain print jobs cause a problem.
    Bill

  • Paging in SPOOL Issue!

    Hi,
    I don't want to make any paging in the spool file but I am always getting a new page after ~65 lines, below my setting:
    set verify off
    set linesize 3000
    set pagesize 6000000
    set trimspool on
    spool /m/home/omc/aa.txt
    select * from KPI order by PST;
    spool off
    It's under HP-UNIX with Oracle 9i, is there any idea about this issue?
    Notice that I did the same under my machine (Windows + Oracle 10g) and everything goes fine (no paging was in the output spool file)!
    Thanks in advance

    OK, I am entering invalid "pagesize" number. But is there a way that I could disable paging in the output spool file; cause the output of the spool file might be more than 50000 row. I tried to set the "pagesize" to zero, OK it will disable the paging but it's also disable the column heading.
    Is there a workaround solution?
    Thanks...

  • Print Spooler Issue

    I recently became unable to print.  My printer is installed and drivers updated, but I get an error when I try to print that tells me my Print Spooler Service is not running, and I cannot start it.
    Windows 7 Home Edition 64bit
    HP Touchsmart 310PC
    Error Popup:
    +++++++++++++++++++++++
    Windows could not start the Print Spooler service on local computer.
    Error 1053: This service did not respond to the start or control request in a timely fashion.
    +++++++++++++++++++++++
    Running diagnostics/troubleshooting does not resolve this issue.
    When trying to print from some applications I get an error that says "No Default Printer Found.  Please choose a printer a try again".  I cannot choose another printer because of the spooler error.
    Any suggestions?

    rjscheper1,
    This should fix it, look here
    I am a volunteer. I am not an HP employee.
    To say THANK YOU, press the "thumbs up symbol" to render a KUDO. Please click Accept as Solution, if your problem is solved. You can render both Solution and KUDO.
    The Law of Effect states that positive reinforcement increases the probability of a behavior being repeated. (B.F.Skinner). You toss me KUDO and/or Solution, and I perform better.
    (2) HP DV7t i7 3160QM 2.3Ghz 8GB
    HP m9200t E8400,Win7 Pro 32 bit. 4GB RAM, ASUS 550Ti 2GB, Rosewill 630W. 1T HD SATA 3Gb/s
    Custom Asus P8P67, I7-2600k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX660 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Custom Asus P8Z77, I7-3770k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX670 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Both Customs use Rosewill Blackhawk case.
    Printer -- HP OfficeJet Pro 8600 Plus

  • Regarding Spool issue while running in background

    Hi All ,
    i am getting some issue i am executing one report in background so the report output of the spool format is disturbed but while i am executing same report in foreground everything is printing perfectly.
    So please suggest me where i missed the scenarios.
    Thanks,
    Venkata Pradeep.

    Have you tried to set the format properties?
    Execute in Background->Properties Button->Format.
    Regards.

  • Printing Purchase Orders in SRM (spool issues, etc.)

    Hi SRM Gurus,
    Could anyone tell me exactly how the printing of PO's works in SRM? What is the step by step description from PO approval to getting the prinout?
    From my understanding, as long as you've configured everything stated from SAP Note 564826 (assign printer LOCL to pgrp, schdule background job RSPPFPROCESS, etc) when you go to transaction "Issue Purchase Orders" and click on the print button...the output will be processed by the background job that we scheduled.
    The problem is that, in the spool request, there are two (2) spool numbers created which I don't understand. One is described as OTF_SPOOL and has the title COMP LOCL SAPMSSY1. This always has the status "Completed" and highlighted as green.
    The other is an unprocessed spool request described as SCRIPT LOCL SAPMSSY1 I dont know what the difference of these two are, but either way...there was no actual printout.
    Is there something I need to know about the background job? It seems the answer is there...
    Regards,
    Marvin

    Access method U (berkeley protocol) would require a printer server which we do not want.
    We defined a new device, LOCM that has the procedure M (email to receiver/owner). Ideally, this would send an email with a PDF copy of the purchase order. However, in the spool request the receiver is ALWAYS defined as WF-BATCH. Even if the PO creator is a different user ID, the receiver would be user WF-BATCH still.
    Does anyone have an idea how to remove the receiver part in the spool request attributes? Or simply replace that with the owner of the spool?

  • Print spooler issues with windows 8

    printer stopped when i switched to windows 8.
    error message telling me print spooler is not functioning
    unable to get it to function...every probram indicates that printer is working properly, yet it shows that I have no printer installed and my printer cannot be found or activated no matter what I do.
    Joseph J Grech

    Hi,
    If updating the printer driver cannot fix the issue, please also try the following steps:
    Clear Printer Spooler Files and Enable the Spooler Service
    =================================
    1. Run "Services.msc" (without the quotation marks).
    2. Double-click "Printer Spooler" in the Services list.
    3. Click Stop and click OK.
    4. Navigate to "%WINDIR%\system32\spool\printers", delete all files in this folder.
    5. Run "Services.msc" (without the quotation marks).
    6. Double-click "Printer Spooler" in the Services list.
    7. Click on Start. In the Startup Type list, make sure that "Automatic" is selected and click OK.
    Regards,
    Arthur Li
    TechNet Community Support

  • LaserJet CM1312 MSP series spooler issues on Windows XP/BootCamp on MBP

    In a mixed environment:
    Mac G5 connected by ethernet to router,
    MacBook Pro wireless connection to router and
    Windows XP PC tower connected by ethernet to router,
    the CM1312 connected by ethernet to router prints fine except for:
    the MMPro (while in BootCamp) and the PC running Windows XP where there are spooling errors and printing fails.
    I need to better understand the issue and find a solution asap.

    Did you install the right device driver for your hardware???
    http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en &cc=us&prodTypeId=18972&prodSeriesId=3558902&prodNameId=3558903&swEnvOID=228&swL ang=8&mode=2&taskId=135&swItem=ma-60887-3

  • Smartform Spool issue - Not pulling all pages

    Hi,
    I am expecting aorund 2000 pages of spool file with a smartform driver program.
    My spooljob is limiting me to only 33 pages and job is still active  when i check using SM37.
    Anything related to spooling is wrong in my code?
    SORT T_ITEM BY FKDAT.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          FORMNAME           = P_FORM
        IMPORTING
          FM_NAME            = FM_NAME
        EXCEPTIONS
          NO_FORM            = 1
          NO_FUNCTION_MODULE = 2
          OTHERS             = 3.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LS_COMPOSER_PARAM-TDNEWID = 'X'.
      LS_CONTROL_PARAM-PREVIEW = ''.
      SORT T_HEADER BY NAME1 KUNNR.
      DATA: V_PREV_CUR LIKE BSID-WAERS.
      LOOP AT T_HEADER INTO WA_HEADER.
        REFRESH: ITEM_ITAB, ITEM_ITAB_TMP.
        CLEAR: V_PREV_CUR.
        LOOP AT T_ITEM WHERE KUNRG = WA_HEADER-KUNNR.
          MOVE-CORRESPONDING T_ITEM TO ITEM_ITAB.
          APPEND ITEM_ITAB.
        ENDLOOP.
        SORT ITEM_ITAB BY WAERS.
        LOOP AT ITEM_ITAB.
          IF SY-TABIX <> 1.
            IF V_PREV_CUR <> ITEM_ITAB-WAERS.
              SORT ITEM_ITAB_TMP BY FKDAT.
              CALL FUNCTION FM_NAME
                EXPORTING
                  ARCHIVE_INDEX        = TOA_DARA
                  ARCHIVE_INDEX_TAB    = ARC_IND_TAB
                  ARCHIVE_PARAMETERS   = ARC_PARAMS
                  CONTROL_PARAMETERS   = LS_CONTROL_PARAM
                  MAIL_APPL_OBJ        = LS_RECIPIENT
                  MAIL_RECIPIENT       = LS_RECIPIENT
                  MAIL_SENDER          = LS_SENDER
                  OUTPUT_OPTIONS       = LS_COMPOSER_PARAM
                  USER_SETTINGS        = SPACE
                  WA_ITAB              = WA_HEADER
                IMPORTING
                  DOCUMENT_OUTPUT_INFO = DOCUMENT_OUTPUT_INFO
                  JOB_OUTPUT_INFO      = JOB_OUTPUT_INFO
                  JOB_OUTPUT_OPTIONS   = JOB_OUTPUT_OPTIONS
                TABLES
                  WA_DEP               = ITEM_ITAB_TMP
                EXCEPTIONS
                  FORMATTING_ERROR     = 1
                  INTERNAL_ERROR       = 2
                  SEND_ERROR           = 3
                  USER_CANCELED        = 4.
              IF SY-SUBRC <> 0.
                WRITE: / 'ERROR in passing variables to the smartforms '.
              ENDIF.
              LS_COMPOSER_PARAM-TDNEWID = SPACE.
              LS_CONTROL_PARAM-NO_DIALOG = 'X'.
              LS_CONTROL_PARAM-PREVIEW = ''.
              REFRESH ITEM_ITAB_TMP.
              MOVE-CORRESPONDING ITEM_ITAB TO ITEM_ITAB_TMP.
              APPEND ITEM_ITAB_TMP.
            ELSE.
              MOVE-CORRESPONDING ITEM_ITAB TO ITEM_ITAB_TMP.
              APPEND ITEM_ITAB_TMP.
            ENDIF.
          ELSE.
            REFRESH ITEM_ITAB_TMP.
            MOVE-CORRESPONDING ITEM_ITAB TO ITEM_ITAB_TMP.
            APPEND ITEM_ITAB_TMP.
          ENDIF.
          AT LAST.
            CALL FUNCTION FM_NAME
              EXPORTING
                ARCHIVE_INDEX        = TOA_DARA
                ARCHIVE_INDEX_TAB    = ARC_IND_TAB
                ARCHIVE_PARAMETERS   = ARC_PARAMS
                CONTROL_PARAMETERS   = LS_CONTROL_PARAM
                MAIL_APPL_OBJ        = LS_RECIPIENT
                MAIL_RECIPIENT       = LS_RECIPIENT
                MAIL_SENDER          = LS_SENDER
                OUTPUT_OPTIONS       = LS_COMPOSER_PARAM
                USER_SETTINGS        = SPACE
                WA_ITAB              = WA_HEADER
              IMPORTING
                DOCUMENT_OUTPUT_INFO = DOCUMENT_OUTPUT_INFO
                JOB_OUTPUT_INFO      = JOB_OUTPUT_INFO
                JOB_OUTPUT_OPTIONS   = JOB_OUTPUT_OPTIONS
              TABLES
                WA_DEP               = ITEM_ITAB_TMP
              EXCEPTIONS
                FORMATTING_ERROR     = 1
                INTERNAL_ERROR       = 2
                SEND_ERROR           = 3
                USER_CANCELED        = 4.
            IF SY-SUBRC <> 0.
              WRITE: / 'ERROR in passing vars to the smartforms '.
            ENDIF.
            LS_COMPOSER_PARAM-TDNEWID = SPACE.
            LS_CONTROL_PARAM-NO_DIALOG = 'X'.
            LS_CONTROL_PARAM-PREVIEW = ''.
          ENDAT.
          V_PREV_CUR = ITEM_ITAB-WAERS.
        ENDLOOP.
      ENDLOOP.

    Hi Vara,
    By default there will be a value set by the administrator for the number of pages you can view in the spool. So to me it looks like this value is set to 33 in yoru case. You can go to setting from the same screen and change thsi setting to display all pages. But beware that this may take a long time some times and also give you a dump at times.
    -Guru

  • Cheque Printing Spool Issues

    Dear Experts,
    After doing payment run through F110 and used the functionality of printing of the cheques through F110 only.
    Its created spool request of cheques.
    After printing the cheques the spool is not getting deleted immediately.
    In the properties of Spool, Delete after printing if no errors is active and in the field Deleted on is showing the future date (8 days from the date of spool generated)
    The spool must get deleted immediately after printing.
    Kindly advice.
    Uttam

    This is taken care by Basis team.
    They will give the settings in spool administartion, according to that setting if system reaches to certain limit of spools, they 'll delete automatically(old spools)
    Rgds
    Murali. N

  • Regarding spool issue

    Hi All,
    I have two output type, in both output type i have define number of copies to be printed through nace.
    while doing good reciept againt PO through migo, 1st  output type form is getting printed three times but for 2nd output type form is getting print only once. is there any other setting that i have to do in somewhere? or what else i can do to resolve my issue.
    please suggest .
    Thanks & Regards,
    Subhanshu Shrivastava
    ABAP-Consultant.

    If your requirement is to trigger the output automatically only once for each document, you can set it for the o/p type in NACE --> select the application --> "Output types" -> "Multiple issuing".
    If you check this OFF o/p type will be only proposed once when you create the PO, if you keep this ON o/p type will be proposed (shown in yellow) every time you open the PO in ME22N.
    Of course this is a control to only allow triggering output only once for each document and is different to the number of copies option controlled through o/p Condition record -> Communication tab which you can use to let the triggering happen n number of times. If the number of copies option is not working correctly then check in your print driver program whether some code is fiddling with NAST-ANZAL

  • Oracle spool issues

    I have a spooling problem. i would like to display header row only once. my select gives back 500 records, i need to display header row in pipe delimited file. the problem is that the spool file header is creating with only few columns. lets say table have 20 columns and spool file header is creating with only 10 column. I am getting values for all columns in spool files.
    when I run select sql munually in toad I am seeing all column names are disply.
    Do you have any idea how to solve to only show all column names in header at the beginning?
    thanks in advance
    i use the following sets
    set pagesize 8000;
    set heading on;
    set verify off;
    set trimspool on;
    set feedback off;
    set underline off;
    set echo off;
    set termout off;

    I did in my earlier script.
    set pagesize 99999999;
    set heading on;
    set verify off;
    set linesize 32767;
    set trimspool on;
    set feedback off;
    --set termout off;
    set underline off;
    set echo off;
    set termout off;
    col sys_date new_value curr_date;
    select to_char(sysdate,'YYYYMMDDHH24MI')||'.txt' sys_date from dual;
    spool C:\promo_rpt.txt;
    select ezaID|| '|' || EMPLOYEEID|| '|' || WORLDID || '|' || WORLDNUMBER|| '|' || FIRSTNAME|| '|' || LASTNAME|| '|' || WORKPHONE|| '|' ||
    EMAIL|| '|' || SUPERVISORVZID|| '|' || DELIGATEDSUPERVISORVZID|| '|' || EBSTATE|| '|' || EZIP|| '|' || CBA|| '|' || CCODE|| '|' || CNAME|| '|' || EXTIND|| '|' ||
    INCREUNIT|| '|' || PAYGROUP|| '|' || TIMEZONE|| '|' || COSTCENTER|| '|' || ESTATUS|| '|' || EMBEGINDATE|| '|' || EENDDATE|| '|' ||
    TPAYPERIOD|| '|' || TPAYPERIOD|| '|' || TENABLED from twotwo;
    spool off;
    exit;
    my spool file out is
    EZAID||'|'||EMPLOYEEID||'|'||WORLDID||'|'||WORLDNUMBER||'|'||FIRSTNAME||'|'||LASTNAME||'|'||WORKPHONE||'|'||EMAIL||'|'||SUPERVISORVZID||'|'||DELIGATEDSUPERVISORVZID||'|'||EBSTATE||'|'||EBZIP
    333|dfdfd|rtrtr|||||||fsdfsdf||dfdfd|||fdfddfdfd|dfd||||||||||
    The spool file is created with header from EZAID to EBZIP only. I am not able to see the column names from CBA to TENABLED in spool file.

  • Spool issue

    Guy's
    i have one print program ,which on execution will create
    a spool request, problem is it show's that there are
    25 page's ,but it dispaly only 10 page's ,how to see
    all 25 pages

    Hi Sanju,
    In transaction SP01,Go to menu bar. Goto - > Display Request - > setting (ctrl + Shift F10 ).Enter the number of pages in From page(put 1 here ) and To page( pute 25 here) that you want to see.Press Enter.It will show you pages from 1 to 25.
    Message was edited by: mukesh kumar

  • Unable to "print" using Adobe PDF ... spooler issue?

    Hello,
    I get the following message when trying to create a PDF file from any of my programs.
    I've got Vista OS.
    "Invalid Adobe PDF printer properties.
    Do not change spooler settings.
    Please select "Print directly to the printer" option (from Adobe PDF printer properties "Advanced" tab.)
    I have not been able to locate the Print Directly option.
    Am not sure how to rectify this problem.
    Suggestions and thanks, Lynn

    The change is made in settings for the Adobe PDF "printer" in Vista.
    In Vista
      Go to "Control Panel"
        Choose "Printers"
          Right click on "Adove PDF"
            Choose "Properties"
              Choose "Advanced" tab
                Choose "Print directly to the printer"
                  Click on "Apply"
                    Click on "OK"

Maybe you are looking for

  • How to write a multi threaded Cache Event Listener

    I have a distributed data cache called tokenCache for my application. I have also added a mapListener to this cache to listen to a particular kind of events. tokenCache.addMapListener((MapListener) new TokenCacheListenerBean(), new MapEventFilter(tok

  • Select sales orders from a list of order type

    I have about 20 customed order types, Z001 to Z020, and I want to select about 8-9 out of the 20 order types. Currently, I am using SELECT VBELN ... INTO CORRESPONDING FIELDS OF TABLE IT_SO FROM VBAK WHERE AUART IN ('Z001', 'Z003', 'Z004', 'Z007', 'Z

  • Firefox Sync doesn't sync bookmarks between smartphone and tablet.Works fine between desktop and mobiles.

    I have a desktop,smartphone and tablet.They all have the latest FX35.They are all signed in and connected to Sync.Sync is the latest version and it works with email and password, instead of pins.On all devices, Sync is configured to sync all items(bo

  • PDF won't open using IE11

    Internet explorer 11 will not open PDF files using Adobe Reader XI The message is   There is a problem with Adobe Acrobat/reader.                              If it is running please exit and try again. (523:523) Please tell me how to fix this. Thank

  • Macbook Pro and Toshiba HDTV Hooked up but no streaming

    I hooked up the macbook to my Toshiba TV using proper cords purchased at BestBuy (Dvi and HDMI) I set the TV to HDMI and it displays the original wallapaper (the purple space scene - which is no longer my background) and that's it. I can have the net