How to save query from oracle in HTML
Posted on June 4th, 2008 in Oracle, Tips And Tricks by tsabrack || No Comment
Here’s some tricks that can help in daily work with oracle. Very often, I need to extract query result from Oracle, or to be more precise ask people to send me query results. It is quite easy to save a file, that’s very true but the formatting is excruciatingly unreadable. There’s a flurry of tools that can allow you to export your query, but sometimes the only things you have at end because you’re connecting to production environment is a good old Sql*Plus.
Here’s the trick. Connect to your DB using Sql*Plus and used the following actions:
SET markup HTML onspool test.htmlSELECT * FROM mytable;spool offSET markup HTML off
When you type command “SET markup HTML on“, your command prompt will look “funky” don’t worry it is perfectly normal. After you exit you will find a nice html file. Certainly not the best format, but much more readable than plain 80 column text.
Alex.