• home
  • forum
  • my
  • kt
  • download
  • Oracle HTML output

    Author: 2008-09-12 10:13:16 From:

    Step 1 - HTML output from sqlPlus

    Oracle is a very feature rich high end database, however sqlPlus is one of it's weakness. Time to time it you need to list the content of a table or view in Oracle using sqlPlus and it usually results a hard interpretable output. There is the possibility to set line size parameter and modify the display size of the columns but it takes to much time. 

    I nice solution would be to display the output in a HTML format. Fortunately we can do that. Now I will show you 2 solutions. The first one is working from the command line and the second one is working inside sqlPLus.

    1. Generate Oracle HTML output from command line:

    Code:
    1.  
    2. sqlplus -S -M "HTML ON TABLE 'BORDER="2"'" user/password @test.sql>test.html
    3.  
    Database F1

    In this example you need to create the test.sql file and put all your sql statements in this file. The result will be written into the test.html file.

    2. Generate Oracle HTML output inside sqlPlus:

    Code:
    1. SET markup HTML on
    2. spool test.html
    3. SELECT * FROM mytable;
    4. spool off
    5. SET markup HTML off
    Database F1

    In this case you can write all of your sql statements between the spool commands. The test.html file will be generated in the actual directory.

    As you can see these solutions are not the best as you can view the files in a browser and not in sqlPlus, however in a lot of cases this solution makes your life easier.

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      Miscellaneous (11)

    New

    Hot