How do I Insert a tab char in the sqlplus output
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: How do I Insert a tab char in the sqlplus output

Hybrid View

  1. #1
    Join Date
    Jan 2001
    Posts
    28

    Question

    Hi everyone,

    I am creating a simple output from sqlplus running a select and spooling it to a file. If I want the columns to be delimitted by a tabchar, how would I do that? I do not want to do 'select col1 || ' ' || col2 || from tablename'.

    I want to be able to use a variable name in place of ' '.

    How do I define it?

    Thanks in advance.

  2. #2
    Join Date
    Sep 2001
    Location
    NJ, USA
    Posts
    1,287
    select a_col||chr(10)|b_col from your_table;

  3. #3
    Join Date
    May 2002
    Posts
    2,645
    There's a missing pipe (bar) on the second concatenator.

    select a_col||chr(10)|b_col from your_table;

    But chr(10) is for a new line.

    [Edited by stecal on 06-14-2002 at 03:14 PM]

  4. #4
    Join Date
    Sep 2001
    Location
    NJ, USA
    Posts
    1,287
    This is just typo. Sure should be:

    select a_col || chr(9) || b_col from your_table;


    -----------------------------------------------------------
    SQL> select 'abc' || chr(9) || 'def' from dual;

    'ABC'||
    -------
    abc def


    [Edited by Shestakov on 06-14-2002 at 03:17 PM]

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