Extra Connections Limited is a small company, formed in 1997, to offer my services as a freelance Oracle and Internet developer.

Key skills include PL/SQL, Oracle Forms, XML and Web Page design. This site is aimed at potential agents and clients, but also contains resources that will be of use to other developers.

Chris Hunt
Managing Director

Lightbulb Joke

I like to hang out in the Google Webmaster Help forum. It’s a great resource, but some of the people you come across there are, well, a bit “special”. In their honour I posted this answer to the question…

How many webmaster help posters does it take to change a light bulb?

Forty…

1 to point out that the lightswitch should be returning a 404 http code while the bulb is dead
1 to say that he read in a forum somewhere that Google penalises dead light bulbs
1 to insist that the light bulb is working really, but there’s a conspiracy by Google to keep us in the dark
1 to offer to link to the light bulb once it’s working
1 to say “never mind light bulbs, why doesn’t Google index strip clubs?”
1 to say that he read on a newsgroup somewhere that Google prefers dead light bulbs
1 to point out that not being able to be lit is a breach of the the standards for light bulbs
1 to claim that Google doesn’t care about lightbulb standards anyway
1 to say oh yes they do!
1 to say oh no they don’t!
1 to wonder why the bulb’s gone out when it has been working fine for 10 years
1 to rule them all, one ring to bind them (sorry, dozed off for a minute there)
1 to suggest you 301 the lightswitch to a bulb which works
1 to observe that the light bulb works better on Yahoo!
1 to ask how long you’ve been running the light bulb
1 to suggest submitting a request to the electric company to make the bulb work again
1 to insist that the bulb work work fine if those ******s at DMOZ would only list it
1 to ask whether anybody else was using the light bulb before
1 to wonder why the Google site in Outer Mongolia is still showing the bulb as lit
1 to suggest that if there’s nothing interesting to look at when then bulb’s switched on, there’s no point in changing it
1 to demand that Matt Cutts drops everything and comes and changes the lightbulb
1 to insist that Matt Cutts should be sacked for not having changed the bulb already
1 to point out that they’ve seen lots of crappier light bulbs which still work
1 to suggest buying “lit lightbulb” in adwords
1 to wonder why they can’t verify the lightbulb
1 to demand Google add a tool to Webmaster Tools for changing lightbulbs
1 to link to the last time we discussed lightbulbs
1 TO SHOUT INCOHERENTLY
1 to point out that this is the wrong forum in which to discuss lightbulbs
1 to say that the bulb would work better if it had a site map
1 to say that the bulb would work better if it didn’t have a site map
1 to ask “what’s a site map?”
1 to say Google is penalising small businesses by not changing their lightbulbs for them
1 to point out that the <meta relight-after> tag doesn’t work
1 to add that <meta name=”keywords” value=”lit”> doesn’t work either
1 to suggest that your robots.txt is denying light to everyone
1 to wonder if the lightbulb would work better if you added a www. to it
1 to threaten to sue Google if the light bulb doesn’t start working NOW! (class action suit, anybody?)
1 to warn people to be wary of dodgy lightbulb optimisers
1 to say that lightbulbs are rubbish, what you really want is a candle

The poor lightbulb never gets changed

I should probably have added another two to make the answer up to “42”.

Matt Cutts liked it anyway.

Read Access to Package Bodies

I’ve recently been asked to grant a user permission to read a package body owned by another user. It’s surprisingly difficult to do.

There’s no object privilege that you can grant that will do this, instead you have to grant read access on DBA_SOURCE to the┬ásecond user for them to see the first user’s source code. One problem with this is that you’ll grant them the right to read everybody’s code. If this is an issue (and it may well be) you’ll have to create a view which limits the rows that can be returned:

CREATE VIEW some_source AS 
SELECT * 
FROM   sys.dba_source 
WHERE  owner = 'X' 
AND    name = 'Y'

Remember to follow my earlier tip with regard to granting permissions if you take this approach.

If you’re happy to grant the straight DBA view to the other user, and they want to view the package source using TOAD, there’s a bit more to do. Firstly, they’ll need access to DBA_OBJECTS as well. Secondly, they’ll need to tweak their TOAD setup as follows:

  1. Select View/Options from the menu.
  2. Select “StartUp” from the tree view on the left.
  3. Tick the “Check for access to DBA views” checkbox.

Next time they log on they’ll be able to see package bodies.

Incidentally, there’s an important moral to this story: Comment your packages in the specification, not the body (well, OK, you should comment the body too). Most of the time you won’t want to do the above hacking, so people need to be able to work out what a packaged program unit does from looking at the part of the package they can see!

Good ALT Attributes

I just found a great article on what you should, and shouldn’t, put in images’ alt attributes. It’s on a site by an outfit called WebAIM, an accessibilty think tank based at Utah State University. There look to be plenty more good articles on the site for web developers who care about their work being accessible to all.

Fun with Oracle Permissions

Here’s an unexpected piece of Oracle behaviour that had me tearing my hair out last night until I figured out what was going on. It’s to do with object permissions as applied to views.

Suppose you have an oracle user called TABLE_OWNER who grants select access on his table to a role which all users have. One of those user, let’s call him VIEW_OWNER, creates a view based on that table and also grants select access on it to everybody.

Now, what happens when a third user attempts to select from the view? They get an “ORA-1031: Insufficient Privileges” error. Remember, they have select permission on both the view and the underlying table, so what’s happening?

The answer is that it’s Oracle security going a bit overboard. VIEW_OWNER has permission to see TABLE_OWNER’s table, but by creating a view of it and granting other users permission to view it, he’s effectively granting them select permission on the table. You need permission to do that, and VIEW_OWNER doesn’t have it. Curiously, this check is made when others try to select the view, rather than when the grant is made.

The solution is for TABLE_OWNER to do this:

GRANT SELECT ON my_table TO view_owner WITH GRANT OPTION;

That gives VIEW_OWNER permission to pass on the privilege, and thus other users permission to select from the view.

W3C Multipage Validator

Here’s a handy tool for making sure that your site stays within the straight and narrow. Give it the URL of your home page and click the “Index & Validate” button, and it will spider your whole site, submit each page to the W3C validator, and tell you which pages (if any) fail the test.

It’s sobering to see how many errors there are in a site that you thought you’d coded with great care to meet all the rules – but that’s what makes this tool so valuable.

Now, I’m off to fix some validation errors…