spaces of SPOOL file how to avoid it?

SPOOL test.utf

SELECT    '* Header record * '
       || '|'
       || TRIM (TO_CHAR (SYSDATE, 'yyyyMMddHH24miss'))
  FROM DUAL
/
<actual query>
select  ....
from  
/

SELECT '* Trailer record *' || '|' || nvl('&rowcount',0)
  FROM DUAL
/
My output is as below
* Header record * |20120418184618   ( Start from 2nd line)
3rd line
Detail record(starts from 4th line)
empty line
Trailer record || 1
Pls tell me
I need on the first line header record
detail on the second record line
File trailer on the 3rd line

Pls help

How to avoid the lines this empty... ?

Kindly help gurus

S
set pagesize 0
select '* Header record * '
       || '|'
       || TRIM (TO_CHAR (SYSDATE, 'yyyyMMddHH24miss'))||chr(13)||chr(10)||
       'row '||level||chr(13)||chr(10)||
       '* Trailer record *' || '|' ||rownum x
from dual connect by level < 10;

* Header record * |20120418122936
row 1
* Trailer record *|1                                                            

* Header record * |20120418122936
row 2
* Trailer record *|2                                                            

* Header record * |20120418122936
row 3
* Trailer record *|3                                                            

* Header record * |20120418122936
row 4
* Trailer record *|4                                                            

* Header record * |20120418122936
row 5
* Trailer record *|5                                                            

* Header record * |20120418122936
row 6
* Trailer record *|6                                                            

* Header record * |20120418122936
row 7
* Trailer record *|7                                                            

* Header record * |20120418122936
row 8
* Trailer record *|8                                                            

* Header record * |20120418122936
row 9
* Trailer record *|9   

Tags: Database

Similar Questions

  • In Adobe Acrobat 10.0.0 comparing two pdf files, it automatically locks. Can you please share how to avoid this type of comparison file accidents?

    Hi all

    In Adobe Acrobat 10.0.0 comparing two pdf files, it automatically locks. Can you please share how to avoid this type of comparison file accidents? If anyone with the idea, please share it.

    Hi sathishk15640596,

    Follow this thread to reset the Acrobat preferences:- How to reset preference settings in format Acrobat.

    If you are on Windows OS, open Acrobat, go to the Help menu and repair the installation.

    I would like to know is what happening to the entire document or certain act.

    Please check with another account user as well as to reproduce the problem.

    Kind regards

    Christian

  • Since the installation of creative cloud, I noticed a lack of disk space, recently I found CC had been storing GB of log files, how can I stop this nonsense?

    Since the installation of creative cloud, I noticed a lack of disk space, recently I found CC had been storing GB of log files, how can I stop this nonsense? 40 GB of space on my SSD HARD drive was recovered today by disabling the 8.1 windows temp folder. I was wondering what "ACC 22/04/2015-10-09 - 26.log" etc, and when I opened the I was shocked to discover Adobe CC was bringing together these huge logs on my computer since I bought and installed last month. WTF Adobe, how can I turn off or limit, as writes to the SSD of constantly to kill them and I do not consider your logs to be important use of space.

    Hi Lewis,

    Apologies for the inconvenience.

    Yes, there is a known and identified as a bug problem.

    Engineering product is right now working on that and I hope that the fixed very soon.

    Kind regards

    Sumit Singh

  • How to avoid the FDM-command being moved files from the OpenBatch folder

    Hello world

    I have a little problem with Batch Processing of the FDM - I need to stop the movement of files in the folder OpenBatch - when a batch is executed.

    The installer by using the Task Manager, a load a Batch Script and Script integration all works very well. However, the process must run every 3 hours, so I need the file "A_LedgerTransLocation_Actual_nov - 2013_RR.txt" to remain in the \Inbox\Batches\OpenBatch\ folder at any time.

    How to avoid the file is moved?


    Best regards
    Frederik




    PS: I noticed on the OTN Forum is it may be possible to script a solution such as:

    FSO1 = CreateObject ("Scripting.FileSystemObject") set
    Set File1 = FSO1. GetFile ("FDM Directory\FDM Application\Inbox\Batches\Openbatch\A_LedgerTransLocation_Actual_nov-2013_RR.txt")
    The BATCHENG value. PcolFiles = BATCHENG.fFileCollectionCreate (CStr (strDelimiter), File1)

    However this is not possible, as the controllers of the company need to edit the. TXT file themselves. They will not be able to edit the script too.

    I don't think you can prevent the FDM, move the file. I'm assuming that the file change in each period to use the last period of POV, so I think that option easiset to copy the file (based on a part of the name (location?) to a temporary location before began the FOM and write again later.)

  • How to avoid null values in file sqlldr

    Hello

    I'm insterting given in the table to a txt file. I avoid nulls inserted into the table using sqlldr. Please give me a solution

    Please give me a solution

    place NOT NULL constraint on the column

  • How to avoid opening the right panel when starting Adobe reader?

    When I open a pdf file by clicking on it, the windows acrobat opens but a lot of space is taken by a list of options on the side panel right / (such as comments, fill and sign, export file aso)-that I didn't need, and also it takes a lot of space and reduced the size of my document.

    How to avoid opening the right panel when starting Adobe reader?

    You can't avoid it.

  • Recovery of the space in a file of data/tablespace in 10g

    We have a tablespace of 30 GB, made up of 15 data files of 2 GB each. However, there are only 5 GB of data in the tables within this space of tables.

    This occurred because the database kept growing (so the new data files have been added) until it was discovered that a single journal table occupied almost all the space. When this table was truncated, he left more space free, but "fragmented" across all 15 files given.

    I'm trying to reclaim the space in the data files to be able to go back to the OS (there is no reason to keep more than 7-8GB to this tablespace).

    From what I've read, the "alter table xxx move" command must relocate the tables to new segments to the 'before' of storage space, and then we should be able to delete the empty data in the end.

    However, when I run this command on a test table, nothing appears to change everything.

    I am running:

    ALTER table AAFDTCRC move;
    ALTER index RM. Regeneration of the PKAAFDTCRC;
    exec dbms_stats.gather_table_stats (ownname = > 'RM', tabname = > 'AAFDTCRC', estimate_percent = > null, method_opt = > 'for all THE COLUMNS of SIZE AUTO', degree = > 6);

    However, when I ask the dba_extents table, is to show the table always distributed in different data files. I use the "alter table" command incorrectly, or is the table dba_extents not up to date with new information?

    Any help would be appreciated. Thank you!

    user11198894 wrote:
    Measure sizes might be a problem. Looks like that the previous data files use a size smaller than those created after measure. And I have naven can't able to find much information about what "alter table... move" when a tablespace has more than one data file. Maybe it does work in this situation?

    You will not be able to reduce the number of files in a tablespace; so if that's your goal, you will need to create a new tablespace and move objects inside. In addition, you will not be able to avoid a performance impact, unless you use the dbms_redefinition package to move tables because the MOVE command makes the unavailable table and requires you to rebuild indexes.

    There is a note that I wrote some time back - with a pointer to a helpfuil script - which gives you a few ideas of how Oracle behaves with management space with multiple files when you move objects: http://jonathanlewis.wordpress.com/2010/02/06/shrink-tablespace/

    If you want to keep the same tablespace you can try something roughly like this:


    Run my script to report on the current use of space
    Reduce as much as possible all the files
    Move objects more big are reaching the end of the files
    Repeat as necessary to step 1

    Concerning
    Jonathan Lewis

  • How to avoid the launch of Labview when called by Teststand VI

    Hi, friends.

    I am a student of teststand. I wrote a few screws by Labview. Now, I want to invoke in teststand environment. But when I run the sequence. LabVIEW automatically launches. How to avoid the launch of Labview when I run the sequence?

    Thank you.

    I'm not sure that I follow what you're saying...  But it seems that when the VI is called, the LabVIEW Development software is started and you want to avoid this.

    If you create an executable file or a dll and that any call within TestStand, she should not call the development environment.  You must have the LabVIEW runtime engine installed on the target computer.

    For several years I used TestStand with LV, if my memory does not have to be precise.  I think that the above worked for me.  However, it seems that I remember something to have the LV code in debug mode, causing to open development environment... but it's a distant memory.    You do not use breakpoints where the LV VI is called, are you?

    R

  • Message says low disk space on recovery D, free space by deleting files to support...

    Original title: get the message on the recovery of free space low disk space by deleting files bear D. I deleted by using disk cleanup, but I still get the same message?

    I got disk spave low recovery D ask me to use Disk Cleanup to delete the old files. I deleted many files and none using programs and I still get the same message. How can I clear this problem? I'm using Vista Home premium.

    Hello

    In NO case should remove anything from the recovery partition.

    Your recovery Partition was photographed on your hard drive during the production of your computer by the manufacturer for all of these reasons.

    1. to reinstall Vista from in the case of a failure of the system, based on individuals or the keys at startup.

    F10 or Alt + F10 or F11 are a couple of different manufacturers use sequences.

    You will need to ask your manufacturer for proper sequence.

    2. to make the recovery disks on if your drive hard breaks down, so that you can then reinstall the operating system on a new hard drive.

    Also ask them how to make records.

    Your D: Recovery Drive is should not be used for backups, defragmented, etc..

    There are backups on an external hard drive.

    To resolve the problems that have arisen with the recovery D: Partition, you will need to contact the manufacturer of your computer to remove all that has been added to it.

    See you soon.

  • How to avoid the "no debug information is found for the module net_rim_cldc/net_rim_os".

    Hello

    Whenever I have debugging on a device of BB, I get the following errors of 2 popup of Eclipse:

    -' no not found for module net_rim_cldc debug information.

    -' no not found for module net_rim_os debug information.

    I know that these messages can be ignored, but I'm tired of these and certainly to lose valuable time with these errors that block the deployment & debug processes.

    How these errors mean, and how to avoid it?

    Thanks in advance

    pre-release notes of the new version of the plugin said that eclipse will automatically download the files of debugging for all devices, so maybe it will solve these problems.

    Currently, it is unclear when the new version will be released.

  • Fonts Download in Microsoft Office Picture Manager, how can avoid it?

    I am a user of Windows 7. I can't download the fonts or install my PC because of the Microsoft Office Picture Manager!
    When I installed a font in my PC, it shows itself as a zip file. After I try to open it but it goes to 'Microsoft Office Picture Manager', but I couldn't see any fonts or its zip files

    How to avoid this problem? Please help me...

    Hello Salim,

    1. what version of Microsoft Office Picture Manager is installed on the computer?
    2. what font you are trying to download and install?
    3. what program you use to unpack the fonts?

    When you are uncompressing the font, you will need to have a compatible program that will decompress the fonts.

    In addition, please refer to this article-

    http://Windows.Microsoft.com/en-us/Windows/change-default-programs#1TC=Windows-7

    I hope this helps. Let us know if you have other problems with Windows in the future.

  • write a line to a spool file

    Hello
    on 11G, I want to run two queries to a file called myfile.sql and spool the result. It is:
    spool file
    select * from Table1;
    select * from table2;
    spool off
    How can I write a line between two requests in queue? :
    col1  col2
    -----   ----
    12     14
    
    one row selected
    
    hier is a line
    
    col1  col2
    -----   ----
    54     16
    
    one row selected
    Thank you.

    Hello

    user522961 wrote:
    How can I write a line between two requests in queue? :

    Use the SQL * Plus PROMPT to write a line of fixed test command.

    For example:

    spool file
    select * from Table1;
    
    PROMPT  here is a line
    
    select * from table2;
    spool off
    
  • How to avoid the SORT operation.

    Hi gurus,

    Oracle version is 11.1.0.7

    I have a select query that has Row_number() over (Partition of col1, col2 order by col1, col2 desc nulls last) function to eliminate the DUP on these two passes.

    Here it costs 4639 for sorting. Now, I added a two other columns in the query Select (has not changed the Row_number analytic function).

    COST of sorting is now 555635.

    This sort operation may use Temp table space. How to avoid the cost of SORTING.

    Note: I use the function analytical only to eliminate duplicates on Col1 and Col2 only.

    How to sort takes a large part of the COSTS by adding only two columns in the select list.


    Any Suggestions...?


    Thank you
    Mike

    I would say:
    1 don't worry unnecessarily about the cost of sorting - do you know if you have a problem.

    2. in general, eliminate from the beginning, sort late (i.e. After you have eliminated all you can)

    3. If you are concerned by the outpouring sort on the disc then you could go to manual management of pga (assuming that you are currently using automatic) for this particular operation and override sort_area_size.

  • How to avoid the export of DB links when you export using exp?

    Hello
    I am trying to export dump of data from tables from test@env1 to test@env2 in user mode. My requirement is to move all tables/roles/indexes...etc. data from one database to another DB with move them any link DB, I wrote below do this with considering them exclusion DB Link.

    Can someone tell me how to avoide DB lie then export? So that when I import the .dat file and existing DB links in test@env2 would not get affected. Y at - it something like exclude in convensional exp? (not expdb).

    I also intend to disable all triggers in target environment during import. Is it OK?


    (Step 1) Procedure to disable triggers in test@env2.
    DECLARE
    l_tri VARCHAR2 (2000);
    CURSOR cur_tri
    IS
    SELECT table_name,
    trigger_name
    Of all_triggers
    Owner where IN ('TEST');
    BEGIN
    I'm IN cur_tri LOOP
    RUN IMMEDIATELY "ALTER TRIGGER ' |" i.trigger_name | "DISABLE";
    END LOOP;
    END;
    /


    -EXPORTER-
    (Step 2)
    Export file:params.dat Param
    QUEUE = test.dmp
    OWNER = test
    TRIGGERS = n
    GRANTS = y
    LINES = y
    COMPRESS = y

    (Step 3)
    test/test_pass exp PARFILE = exp_params.dat

    (Step 4)
    Import the file:exp_params.dat Param
    QUEUE = test.dmp
    OWNER = test
    TRIGGERS = n
    GRANTS = y
    LINES = y
    COMPRESS = y


    -IMPORTANT-
    (Step 5) followed by importing a file param

    Import file Param: imp_params.dat
    QUEUE = test.dmp
    FROMUSER = test
    TOUSER = test
    TABLES = (*)

    (Step 6) followed by import
    IMP test/test_pass PARFILE = imp_params.dat

    Any help would be appreciated.
    Thank you.

    Can someone tell me how to avoide DB lie then export? So that when I import the .dat file and existing DB links in test@env2 would not get affected. Y at - it something like exclude in convensional exp? (not expdb).

    I fear this is not possible in normal export.but is possible with EXCLUDE prameter in expdp (but I've never tested and just assuming). You can give a try

    I also intend to disable all triggers in target environment during import. Is it OK?

    He can do faster import

  • I downloaded Safari 10 and now every page that uses Java asks me to activate or not. How to avoid this new feature? I have problems to access my bank account.

    I downloaded Safari 10 and now every page that uses Java asks me to activate or not. How to avoid this new feature? I have problems to access my bank account.

    I think they mean JavaScript.

    In your Safari menu bar, click Safari > Preferences and then select the Security tab, and then select: Enable JavaScript

Maybe you are looking for