Home » RDBMS Server » Server Administration » Formatting query result set.
Formatting query result set. [message #58720] Fri, 26 September 2003 19:44 Go to next message
Kapil
Messages: 145
Registered: May 2002
Senior Member
Is there any way that i can bold the text when a query returns a result set. i am trying to do a report format
the Heading has to have bigger font and the column heading has to be bold. is it possible?
Re: Formatting query result set. [message #58725 is a reply to message #58720] Sat, 27 September 2003 01:24 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
within sqlplus? NOPE.
sql*plus is a text based interface.
if u can afford to use sql*plus coomand line, you can change the font.
alternative is to create a html report from sqlplus.
where, you can set your bold face etc.
you use set markup or
just embed your html tags 

Re: Formatting query result set. [message #58726 is a reply to message #58725] Sat, 27 September 2003 06:41 Go to previous messageGo to next message
Kapil
Messages: 145
Registered: May 2002
Senior Member
How do i create a html page from sqlplus, please can u provide me a small eg., that will be helpful. i was trying the documentation eg, but it says "SP2-0158: unknown SET option "TABLE" Usage: SQLPLUS [[ [[]] [[]] [[]] ]] where ::= - | -? | [[ [[-......."
so if u can provide me a small eg, to get statred i will be gr88
Thanks.
Re: Formatting query result set. [message #58733 is a reply to message #58726] Sun, 28 September 2003 21:17 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
[code]did you use the set markup option?
if that is not working for you, you can go with the hard way, which i find very flexible with options, though it is a tediious job to do it.
idea is to embedd the html tags along with select statements, spool the results to a file with .html extennsion.

something like this

--
-- note that i have given extra spacing in the html tags
-- here.
-- it is becuase , this forum is html based and will NOT display
-- the html tags.
-- so in script, remove the spaces in html tags
mag@mutation_mutation > get one
1 set feed off
2 spool myfile.txt
3 prompt < pre >
4 ttitle center '< h1 >My report< /h1 >'
5 select '< b >'||ename||'< /b >',job,sal from emp;
6* spool off;
mag@mutation_mutation > @one
[code]
My report
SMITH CLERK 800
ALLEN SALESMAN 1600
WARD SALESMAN 1250
JONES MANAGER 2975
MARTIN SALESMAN 1250
BLAKE MANAGER 2850
CLARK MANAGER 2450
SCOTT ANALYST 3000
KING PRESIDENT 5000
TURNER SALESMAN 1500
ADAMS CLERK 1100
JAMES CLERK 950
FORD ANALYST 3000
MILLER CLERK 1300
mag@mutation_mutation > !cat myfile.txt
                                         [size=7]My report[/size]
[b]SMITH[/b]      CLERK            800
[b]ALLEN[/b]      SALESMAN        1600
[b]WARD[/b]       SALESMAN        1250
[b]JONES[/b]      MANAGER         2975
[b]MARTIN[/b]     SALESMAN        1250
[b]BLAKE[/b]      MANAGER         2850
[b]CLARK[/b]      MANAGER         2450
[b]SCOTT[/b]      ANALYST         3000
[b]KING[/b]       PRESIDENT       5000
[b]TURNER[/b]     SALESMAN        1500
[b]ADAMS[/b]      CLERK           1100
[b]JAMES[/b]      CLERK            950
[b]FORD[/b]       ANALYST         3000
[b]MILLER[/b]     CLERK           1300

mag@mutation_mutation >

Previous Topic: How to replicate db on two diff. platforms??
Next Topic: how to get a fixed port for the connections to a server in windows
Goto Forum:
  


Current Time: Fri Sep 20 07:00:11 CDT 2024