Formatting Sql output

I know this question is very vaque.
But I need to ask.

I need to format the sql output with some text in bold or a different color (??).
The problem is the third party control where i need to  print this
sql output does not support formatting.

Is there any way to do it ??
acptAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
>I need to format the sql output with some text in bold or a different color (??).
coloring output requires rich text or html or the like.
so unless you get some web page code that displays the data, applying colors etc, you won't find anything that colors your data.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ivo StoykovCommented:
Hello acpt,

> third party control ?

what application are trying to use about printing? Client, Web based?

HTH

I
0
kripa_odbaCommented:
Hi,

SQL Plus is offering to turn on HTML Markup tags while spooling to a file. You can use this option to generate an HTML file.. If you want to give color to particular places then you need to incorporate html tags in ur sql script.... I am pasting small code for example in this window..Hope this will help you...
REgards


Set markup html on spool on preformat off entmap off -
HEAD "<TITLE>Health Check  Report</TITLE> -
<STYLE type='text/css'> - <!-- BODY {background: #FFFFFF} --> - </STYLE>" -
BODY "TEXT='#0066CC'" -
TABLE "class=detail cellspacing=0 WIDTH='98%' BORDER='1'"
set echo off
spool c:\healthcheck.html
REM Database Health monitoring script.
REM Segments Max extents & Current extent comparison
REM
set line 180
set pagesize 10000
set feedback off
prompt
set heading off
select '<H3> Health Check for '|| Name || ' as on '|| to_char(sysdate,'DD-MON-YYYY:HH24:MI:SS')||'</h3>' Time from dual,v$database;
PROMPT <h4> Objects Reaching Max extents </h4>
set heading on
prompt
col segment_name format a40 heading "Object Name"
col max_extents format 9999999999 heading "Max Extents"
col curr_extents format 99999999999 heading "Curent Extents"
prompt <font  color="#ff0000">
select a.segment_name,a.max_extents,b.curr_extents from dba_segments a,(select
segment_name,max(extent_id) curr_extents from dba_extents group by segment_name) b where a.segment_name = b.segment_name
and (a.max_extents - b.curr_extents) <= 10;
prompt </FONT>
set heading off
Spool Off


0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

actonwangCommented:
>>BODY "TEXT='#0066CC'"

     not supportd in oracle 9i. Are you using oracle 10?
0
actonwangCommented:
>> some text in bold or a different color

      your question is a little vague. what do you mean by this?

      HTML might be way to do from sql*plus. But it might require other steps to do it:

     you need to do is to turn HTML mode on and insert css style into sql:

-- use HTML mode
set markup HTML on  
spool test.html
select col1 from <your table>
/
spool off
set markup HTML off
0
schwertnerCommented:
Oracle Reports is what you need!
Oracle Reports can produce output in every 'known' format: .pdf, .xls, .xml, .txt, .html
with needed colors, fonts, headers, footers, etc. and even is able to email the produced files.

Disadvantage: needs installation of Oracle developer Suite and Forms/reports server
But if you will produce many reports definetelly you need Reports generator (there are also other; Crystal Reports,...).
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.