Daily Archives: March 3, 2008

Syntax highlighting for code in WordPress

I came across a post about syntax highlighting for code in WordPress on Thomas Roach’s blog who in turn saw it on Tyler Muth’s blog. There is a plugin called syntax highlighter which does all the beauty. Use is very simple:

Download it from here.

Upload to your blog’s plugins folder and extract it over there.

Now (on WordPress) go to Plugins page and activate the plugin.

To use it wrap your code like

code.JPG

and you are done.

Wanna see, how does it look like 😉

SQL>drop database;

Isn’t beautiful 😉

Missing grants

Today one of my colleague was working on a simple PL/SQL procedure. Based on some logic it was returning count(*) from all_tab_columns for few tables. It gave count incorrectly for one table out of around fifty in total. He just hard coded the table name and ran it but again it showed count as zero.

Then he took the code out of procedure and wrote it in DECLARE, BEGIN, END and after running it showed the correct count. But ran as database procedure it always shows incorrectly.

Finally just as hit and trial, he gave SELECT on the TABLE to database user [Table was in different schema], used to run the procedure and everything was ok. Isn’t it bit stupid 🙂

Update: Well, it happens for a reason. Nigel Thomas pointed out in the comment. The reason is that privileges granted to a role are not seen from PL/SQL stored procedures. You need to give direct grant to the user for this or another method is to define the procedure or package with invoker rights.

Thanks Nigel 🙂