Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Location
    Los Angeles, CA
    Posts
    28

    Unanswered: Formatting Question

    I am having some trouble outputting my sql to a report. The problem is that the output looks fine until it is sent through Email, then the tabs in the output “off shift” the data in the columns and the report does not look very good. If I paste it into a program like notepad it looks fine. But not all programs treat tab stops the same.

    Question:
    How can I remove the tabs from the output and still have the columns line up?
    Preferably Oracle would just substitute the correct number of spaces instead of the tabs. There must be a command in Oracle to do this.

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    I never tried to send a report via e-mail so can't help you much, but I may try.

    One solution might be setting one of the SQL*Plus options:
    TAB {OFF|ON}

    Determines how SQL*Plus formats white space in terminal output. OFF uses spaces to format white space in the output. ON uses the TAB character. TAB settings are every eight characters. The default value for TAB is system dependent.
    You'd use it as
    Code:
    SQL> set tab off
    SQL> select * from dept;
    
        DEPTNO DNAME          DLOKAC
    ---------- -------------- -------------
            10 PRODAJA        BOSTON
            20 NABAVA         NEW YORK
            30 ERC            PARIS
    If this won't work, consider another option: it seems that e-mail uses proportional font (such as Arial) while notepad (and SQL*Plus, after all) use non-proportional font (like Courier). This *might* be a reason why e-mailed report looks not very nice.

    Now, could you force it to use a non-proportional font while e-mailing the report?

    If nothing of this helps, wait a little bit more until someone else suggests another solution.

  3. #3
    Join Date
    Feb 2004
    Location
    Los Angeles, CA
    Posts
    28

    Thanks !

    Littlefoot;

    That worked perfectly! Looks great now.

    Thanks

  4. #4
    Join Date
    Jul 2003
    Posts
    2,296
    it took me forever to find that damn SET TAB OFF setting.
    was driving me crazy on the emails I was sending the Oracle DBAs from the server
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

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