Thursday, April 13, 2006

Obsessive, compulsive me

I have little doubt that I "suffer" from a mild case of OCD (obsessive compulsive disorder). What other explanation is there for the TEN BOOKS I have published on the Oracle PL/SQL language?

[ Note: I put "suffer" in quotes because pretty clearly I haven't actually suffered, in fact, I have benefited from my obsession. I also use quotes because I generally find objectionable the tendency of medical professionals to give names to behaviors and medical conditions they don't necessarily really understand or are outside the norm. ]

And then there is my attitude towards GUIDs. I talked about these "Globally Unique Indentifiers" earlier in my blog. A GUID is a long sequence of characters that are supposed to be globally unique -- that is, the likelihood of a particular sequence of characters appearing (returned by the GUID generating function) more than once on any computer running on our globe is miniscule. Thus, you can use GUIDs when you need unique values that span, say, database instances or multiple networks.

I just ran into the need to generate about a dozen GUIDs for new assertions I have defined in Qute, the Quick Unit Test Engine. Unfortunately, I forgot to enable output to the screen for my block of code, so I could not use those GUIDs.

And I found myself feeling sad, a sense of loss. I found myself thinking: I just wasted those GUIDs. They will never reappear (as I would ever know!), they are gone forever.

Worrying about "losing" or "wasting" GUIDs? Now, that's surely a bit obsessive!

Time to enable output, run my script again, grab those GUIDs, and get on with my life!

Friday, April 07, 2006

Soduku and PL/SQL

In my continuing series of "Isn't it amazing what you can do with PL/SQL?" I offer below an email I received from a very clever fellow named, Phillip Lambert:
Hello Steven,

I'm not sure how much Sudoku puzzles have caught on in the US, but they are fairly big in the UK, particularly in all of the daily papers. Well I've probably been using PL/SQL much too long or probably am well due for retirement out of computers, but I was presented with a challenge the other day which some might consider quite sad. I wrote a Sudoku puzzle solver in SQL and PL/SQL which solves most puzzles presented to it.

The proud thing about it is that a colleague of mine who gave me the idea wasn't able to get his MS Excel VBA solution to work properly. Another colleague also took up the challenge, and again could not get his Java solution to fully work and has spent weeks compared to my days programming it. I'm not sure whether this is saying something for SQL and PL/SQL, but in any event I thought you might be interested. This could be a great opportunity to see whether anyone can use an alternative language to write a solution in less lines of code than a PL/SQL solution - now that would be a challenge!!
To check out Phillip's implementation of a Sudoku puzzler, click here.

Thursday, April 06, 2006

PL/SQL + PDF = PL/PDF - PDF docs from PL/SQL programs!

I am, as most who read my books and my blog must know, quite obsessed with the Oracle PL/SQL langauge. So I am always on the lookout for new and amazing things peoplea re doing with PL/SQL. I recently came across...


"Generate dynamic PDF documents from data stored in Oracle databases using the PL/PDF program package. PL/PDF is written exclusively in PL/SQL. It is able to either store the generated PDF document in the database or provide the results directly to a browser using MOD_PLSQL. No third-party software is needed; PL/PDF only uses tools provided by the installation package of an Oracle Database (PL/SQL, MOD_PLSQL). Use PL/PDF to quickly and easily develop applications with dynamic content but also quality presentation and printing capabilities."

Sounds like fun! I have only played around with PL/PDF a little bit, but it looks like they have put together a very nice, clean API to the underlying functionality, making it extremely easy to use PL/PDF. To give you a sense of that, check out the explanation of their approach.

You can trial PL/PDF by downloading the software and specifying 'TRIAL' word as the certification key. Limitations: max. 5 pages, watermarked pages.

My compliments and best wishes to Laszlo Lokodi and others at PL/PDF for showing how useful and flexible PL/SQL can be!