Wednesday 23 July 2008

How to post your code in the Oracle Forum

This may have been already posted somewhere else. However, I still see people not knowing how to post their code properly. If you want to show your code in a posting on

http://forums.oracle.com

use the following tags and put your code between them

[code]

[/code]

This will show your code formated and readable like this


SELECT CASE
WHEN cnt > 20
THEN '<font color="red">' || cnt || '</font>'
WHEN cnt <= 20
THEN '<font color="green">' || cnt || '</font>'
END AS x
FROM "MYTABLE"
WHERE TO_CHAR ("MYTABLE"."DATE", 'YYYY-MM-DD') >= '2007-04-01'
AND "MYTABLE"."SERVCODE" <> 'OBS'


instead of something like this

SELECT CASE WHEN COUNT > 20 THEN '' || cnt || '' WHEN COUNT <= 20 THEN '' || cnt || '' END AS X from "MYTABLE" where TO_CHAR ("MYTABLE"."DATE",'YYYY-MM-DD') >='2007-04-01' and "MYTABLE"."SERVCODE" <>'OBS'

3 comments:

Carl Backstrom said...

I created a greasemonkey script awhile back that adds some buttons for that directly into OTN posting form http://carlback.blogspot.com/2007/09/greasemonkey-otn-forums-greasy-otn.html

Anonymous said...

and IMHO Carl's GreaseMonkey script is the best thing since sliced bread!

Unknown said...

Thx to GreaseMonkey and Carl.
Saves a lot of work.