Spooled output has a tab not spaces
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Spooled output has a tab not spaces

  1. #1
    Join Date
    Mar 2002
    Posts
    5
    The problem:

    When outputing a file

    the spacing between the fields contains tabs rather then pure spaces.

    FIRST COUPLE LINES OF SQL
    Set echo off pagesize 0 head off feed off veri off
    SELECT
    SCHD4_PART || ' ; '


    The field is 20chars long.
    02-084_____________;

    But when doing a vi in unix on the file , the first space is actually a space, then there is a tab , then several more spaces?!?!?
    Why , and how can i make the "space" all real spaces.

    I've tried TRIM and PAD with no luck !!


  2. #2
    Join Date
    Sep 2001
    Location
    NJ, USA
    Posts
    1,287
    select replace('abc'||chr(9)||'def'||chr(9)||'AAA', chr(9), rpad(' ',4, ' ')) from dual;

    where 4 - tabspace parameter

    select replace(UR_STRING, chr(9), rpad(' ',3,' ')) from dual;

  3. #3
    Join Date
    Mar 2002
    Posts
    5
    Pretty new at this....sorry in advance....

    But what i gather from your reply is that i would be reformating the column in the table..

    If this is the case, i can't.

    If this isn't the case then i don't understand the answer

    Basically what i'm trying to achieve is to output a file that can be read by another program , the program is sensitive to tab'd spaces ..

  4. #4
    Join Date
    Sep 2001
    Location
    NJ, USA
    Posts
    1,287
    Explain first post:

    1. In ur source text (or table) had tabspace parameter = X (for example 3)
    -- 1 tab symbol replaced 3 space symbols

    for restore ur table with needed format u should use some tabspace parameter as in source text.

    in statment: select replace(SOURCE_TEXT, chr(9), rpad(' ',3,' ')) from dual;

    chr(9) - symbol TAB
    3 - tabspace parameter (u can change it as u need)
    ' ' - blank symbol

  5. #5
    Join Date
    Jul 2008
    Posts
    1
    I just registered here after finding a better solution to this problem. I googled 'rpad tab' and found this as the third link in the search results.

    I had the EXACT same issue, where I was seeing tabs in the file on a unix system. You need to tweak your sqlplus settings for output:
    SET TAB OFF

    Problem solved!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width