Saturday, March 31, 2007

Passing the time in Zurich

Subject: A fine visit to Zurich

I am now en route from Zurich to Vilnius, Lithuania -- the third stop on my two week "Best of PL/SQL" seminar series for Oracle Corporation this spring. The weather has been wonderful in Zurich and Copenhagen - clear and sunny, and the students in my classes have given me lots of good ideas for better ways to use PL/SQL and excellent suggestions for improving Quest Code Tester.

Zurich was an especially nice stop. Generally, when I do trainings for Oracle the local Oracle office pays no attention to me until I show up at the training location. That's understandable; they're all busy and this is just a job. But it's really nice when people in the city offer some hospitality (and I did receive very warm welcomes in Talinn, Estonia and Prague last year).

This year, Zurich was most hospitable. I was told that I would be picked up at the airport. Well, that's happened before and it has always been a professional driver from the transport service favored by Oracle. So I expected something similar. instead, I was met at the airport by Lutz Hartmann, a DBA and former Oracle trainer, who had recently left Oracle to offer training independently. It was so nice to be driven by a tekkie, someone who actually wanted to spend some time with me. Lutz helped me for the next two days, with transportation, with logistics at the seminar, and also by arranging a really wonderful dinner on Thursday night.

He'd spoken with Laurent Schneider, the only person in Switzerland who is both an Oracle ACE and an Oracle Master. I'd met Laurent at a couple of Oracle Open World. He is a very, very smart fellow, with a passion for chess and just about any other game. Whenever we are together, he insists that we play chess. Needless to say, I have never beat him, and usually the game is so lopsided as to be embarrassing. But he is unfailingly polite about all that. In any case, Laurent also knew from OOWs past that I very much enjoy billiards. So at his recommendation, Lutz arranged dinner at a restaurant that was also a billiards hall. That was a fun, fun evening -- a great change from talking for seven hours a day (which I'd just done for three days straight).

I had high hopes for escaping playing chess with Laurent on Thursday, but he was too clever by half and soon we were huddled around a board, placed on a billiards table in very poor light. Time to play chess! And incredibly, after a dozen moves or so, I had a superior position. But then...we had to take the board off the table and move to a very awkward spot with even less light. In fact, I noticed that the way Laurent was sitting blocked most of the light to the board. I struggled valiantly in the darkness to maintain my advantage, but actually I was psychologically resigned to losing from the first move and sure enough I soon made a small and then large blunder -- and the game went to Laurent.

Now, I want to be very, very clear: I do not believe that Laurent deliberately made it hard for me to see the board and therefore cause me to lose the game. No, no, not at all. Just an innocent coincidence. No hard feelings....

The two day training (Best of PL/SQL) that brought (or is bringing) me to Zurich (and Copenhagen and Vilnius and Utrecht) was held at the former FIFA headquarters in the hills above Zurich Centrum. Really nice place with an incredible view. The best part of the location, though, was the foosball (table soccer) table that was in the lobby of the building. Both days, during the break for lunch, I demonstrated my incredibly lame offensive skills and my pathetic goalie capabilities while the Swiss handily outplayed me. Still, great fun....

This conference center was also in a very posh neighborhood (Sonnenberg) of Zurich, which is saying a lot, because Zurich is a very rich (and beautiful) city. The obsession with making, buying and wearing incredibly expensive watches should tell you lots about this city. This is the view out from the front door of the FIFA building up to the house across the street.

Monday, March 26, 2007

Sacha Baron Cohen and his Terrible, Horrible, No Good, Very Bad Movie: Borat

I finally got around to watching Borat. I'd been putting it off, because the little bit I'd read and seen about it disturbed me. Mainly: why would Sacha Baron Cohen, an accomplished satirist, mock a real country and its people when he could so easily make up a "funny" sounding name for a fake Eastern European country? And he didn't just mock the people of Kazakhistan. He charged them all with being vicious anti-Semites, one of the most damning and damaging things you can say about a person in this post-Holocaust world.

But all the television ads and various pundits talked about how amazing the movie was. Cohen even appeared on Jon Stewart's The Daily Show (staying fully in character), a program I admire and respect greatly. And Stewart treated Cohen with some level of admiration.

So we rented the movie, my wife and I.

And all I could think of when it was done was: I am so glad I didn't actually pay to see that awful production in a movie theater.

It was far worse than I had been led to expect. Sure, there were some funny parts (usually derived from the jaw-dropping feeling of "Did he really just do that?"), but to my mind it was an extremeley crude production that got its laughs by:

* Truly dumb and revolting sight gags. The very worst of it: Cohen wrestles with his obese director, both of them naked and the latter's balls slapping against Cohen's face. All I could think was: how badly did Cohen want to make this film that he would go through that? Just disgusting....

* Endless references to penises, vaginas, prostitutes. "Perfect" movie for teenage males, but how could anyone elevate this garbage to "The Best Comedy Ever Made"?

* Incredibly offensive mockery of rural people. People living in his "home village" in Kazakhistan apparently find incest just fine and rape perfectly acceptable. They are all stupid beyond (below?) measure.

* Revealing the misogyny, bigotry and anti-Jewish sentiments of drunk people, frat boys, and "rednecks." Wow. That is really amazing. Who would have thought? Like we didn't know that you can find people pretty much anywhere you look who are ignorant or prejudiced.

So what's the big deal? People make stupid movies all the time, like Jackass One and Two.

Sure they do. But those movies don't get bandied about as the best comedy ever made. Why was this film treated so differently?

After thinking on it for awhile, I have come to this conclusion:

Borat got a free ride into the Stratosphere of fame and profit (the film must have brought in a fortune) because Cohen leverages the fact that he is Jewish, he plays a crude anti-Semite, and he castigates an entire nation as anti-Semitic. Turns out, you simply can't go wrong playing that card.

We all know how awful "those people over there" are when it comes to Jews. And if we don't know, well, we certainly aren't going to question it, because then it might as seem as if we are going "easy" on those anti-Semites, or that we don't take anti-Semitism seriously.

In other words, I think Borat was hyped the way it was by Western pundits and media as another guilt payment for the Holocaust. Jews have always been and always will be victims, Jews were almost all killed off by Hitler (and Stalin and Spain and....). Poor, poor Jews.

Now, please don't get me wrong. I am totally disgusted by anti-Jewish expression and action. The Holocaust was a terribly tragedy -- for Jews, for Gypsies, for homosexuals, for humanity as a whole. But can't we learn the right lessons from this tragedy?

Hitler's attempt at extermination of the Jews was made possible by decades of vicious stereotyping and scapegoating of an entire people.

Surely, then, Jews more than any other people should take care to avoid doing the same thing to another people. Yet that is exactly what Sacha Baron Cohen has done in Borat.

Cohen shouldn't be treated as an artistic genius. He should be considered a dangerous bigot who makes the world a more dangerous place. Hmmm. That sounds really harsh. OK, he might not be dangerous. He might not even be a bigot. But he is contributing to the bigotry of the world in dangerous ways.

I don't know if he has yet apologized to the people of Kazakhistan, but he certainly should. And perhaps he should also consider donating the profits of his film to a group that battles all kinds of bigotry, not just anti-Semitism.

Wednesday, March 21, 2007

Perfect Symmetry or a Case of Mistaken Reality?

A long, long time ago, I was a college student. In 1976, I entered the University of Rochester extremely enthused about mathematics. I took two to three math classes in each term, and quickly moved into advanced subjects. Then during my second year, I discovered poetry, philosophy and politics. Mathematics instantly paled by comparison, and I shifted my course load (and extra-curricular activities) accordingly.

Imagine my surprise (and utter dismay) when, midway through my senior year, I got a call from the administrator at the math department. She told me in no uncertain terms that I would not be able to receive my degree in mathematics (hey, it was still my major!) unless I took one more course. And not just any course, of course. It would have to be a 300 or 400 level class. Oh, the agony! But I somehow muddled through and did in fact graduate in 1980 with a degree in mathematics with high distinction - I kid you not. There's no accounting for.....well concealed disengagement.

And off I went through a cascade of programming jobs, without a single conscious career choice, until I landed at Oracle Corporation and the rest, as they say, is my personal history.

Anyway....I mention all of that to show that I really did have a fascination with mathematics (more accurately, abstract thinking and symbolic logic), and that fascination survives to this day. It's certainly served me well in my chosen profession of programming. And lately, I have found my focus shifting from the abstract manipulations of formulas to the brain that performs these manipulations.

I am now sitting on a plane that maybe soon will take off and return me from San Diego to Chicago (the pilot just announced that a baggage handler banged his vehicle against a cargo door and bent some metal. They believe it is not structural and that they can fix it and we can be on our way. Sigh.....). While contemplating yet another seriously delayed arrival at O'Hare, an article in the NY Times Science section caught my eye. Titled "The Scientific Promise of Perfect Symmetry," the article describes the results of a collaboration among mathematicians: the full elaboration of the E8 Lie group. This elaboration involved the computation of some 200 billion numbers, resulting in an elegantly symmetrical form.

Yeah, right, whatever.

I am sure it is an accomplishment of the mind most remarkable, but what I found striking was the conjecture that this structure and the conclusions we (oh, you know, "we" as in those other humans who live in the world of string theory) can draw from it, may be helpful in understanding some fundamental characteristics of our world/universe.

And then I read the closing statement:

"It could well be E8 that determines the deep inner structure of the universe," Dr. Adams [professor of mathematics at the University of Maryland who led the project] said.

Several fibers of my being instantly rebelled. That statement, I believe, reflects a very deep arrogance and misunderstanding of our world. And I knew that you would want to know that I felt this way, and that you would now be on the edge of your seat, waiting for me to explain.


Here's my problem with such statements: mathematics, physics, etc. are incredibly powerful tools that help us figure out how to manipulate the world around us to meet our needs (make us more comfortable, make life more convenient, etc.).

But the theorems of mathematics and physics do not determine anything in the world outside of our heads. That world simply is.

Here's another way of considering my point: imagine for a moment that humans no longer existed in the world (given the proclivities of George Bush and his ilk, and the sadly weakened state of our democracy, this is not such a far-fetched idea). No more people. No more books, no more Internet. Got it?

OK, now ask yourself these questions:

* Would the deep inner structure of the universe still exist? I would say "yes". The universe, physical reality, would go on existing as it always has. It simply is.

* Would mathematics still exist? I would say "no." Mathematics has no existence outside of our brains. There are things in the world that seem to conform to various mathematical formulae, such as Fibonacci's sequence. But all that really confirms is that our brains, existing in the same physical world as flowers, planets and quarks, construct patterns along the same lines as other organic systems of the world.

* Would gravity still exist? I would say "no." Gravity is an explanation for why when we jump up into the air, we come back down to the ground. But there isn't really any such "thing" as gravity. It's an idea in our heads, and even if there is no brain to come up with the theory of gravity, when we jump up into the air, we will still come back down to the ground.

* Would the world go on, and likely in a much more sustainable and "natural" fashion? I would say "yes." Lately, in fact, I have found myself thinking: if insects disappear, the global ecology would be shot to hell. But if humans manage to snuff themselves (ourselves) out? I imagine there will be no great cataclysm.

I imagine you get the idea. And some of you are undoubtedly saying to yourself: "This is a ridiculous splitting of hairs." I beg to differ. I think that humans are all too enamored with themselves and have largely lost perspective on our place in the world.

We tend to lose sight that all of our scientific theories, our understanding of the molecular structure of the world, our explorations into the incredibly bizarre quantum mechanical structures are nothing more than mental constructs. They will never be anything more than mental constructs. How can they be anything but that? We look at the world around us, we take in that data, we identify patterns in that data, and draw conclusions about how the world works, in order to change the way we relate to that world. But the world simply is, simply "works," with or without us.

Having said that, I am not arguing that we ignore or reject these theories, nor that we should treat them on par with belief systems like "God created the heavens and the earth." Absolutely not. Scientific theories represent some of the greatest accomplishments of humanity. I, for one, have no interest in abandoning (all of) what we have learned and built. I like electricity. I like running water. I dearly love my low-flush toilet.

In contrast, organized religious belief systems, things we take on faith that are fundamentally irrational, are to my way of thinking inherently dangerous -- if they move from the personal, individual manifestation to the public sphere. I hope that someday we will consider them curious relics of a persistent but regrettable stage in our evolution towards truly civilized beings. [But I don't think we'll make it that far.]

The world exists, and we exist in it. We achieved self-awareness, and that great mystery allows us to utilize our brains in increasingly sophisticated ways to alter the world to suit our needs and desires.

And while I believe that the most arrogant statement a human being can say is "We are created in God's image," I would say that the declaration "It could well be E8 that determines the deep inner structure of the universe." does not trail all that far behind.

Tuesday, March 13, 2007

Another handy travel accessory

Let's's Tuesday, so this must be Boston.

Yes, another posting on how to make one's travel life more ergnomic. That is, another tip on how to keep on working without screwing up various parts of one's body, even when you spend most of your time in planes.

Why would I be paying so much attention to this issue? Here's my travel schedule last week and this week:

Monday March 5 - Dallas
Tuesday and Wednesday, March 6-7 - Atlanta
Friday, March 9 through Monday March 12 - Florida
Monday, March 12 - fly to Philly (home for 3.5 hours)
Tuesday, March 13 - fly to Boston
Wed, March 14 - fly to Ottawa

Then home for a whopping 3.5 days, then off to San Diego

Then home for a remarkable 5 days, then off to Europe for 2 weeks.

And my upper back is killing me, from hunching my shoulders up so much, trying to type on my keyboard on the plane, especially when I have to use the touchpad.

In any case, here's the latest cool device: the WowPad.

It is a super-thin, stiff, accurate mousepad. It comes in especially handy when I am trying to work on an economy class fold-down/out tray and the tray has an indented section for a cup. The optical mouse dies, but you just lay the WowPad over it and everything is copacetic.

It is also very handy when I arrive at my hotel room and find that the desk surface is glass or something else that totally screws up the optical mouse.

I like it lots.

Tuesday, March 06, 2007

An item of historical curiousity

I was searching my hard drive for some articles I was sure I had already written (see? This is what happens when you write compulsively. You can't even remember what it is you actually wrote and what might still just be an idea in your head), and came across a file named PROPOSAL.DOC dated April 5, 1994.

It is the original proposal I sent to O'Reilly and Associates for my first PL/SQL book. I thought it might be of some interest to those who have benefited from Oracle PL/SQL Programming (the book), so here it is in all its glory:

Steven Feuerstein
Compuserve: 72053,441

April 5, 2007

Frank Willison
O'Reilly and Associates

Dear Mr. Willison:

Attached you will find a proposal for a book on Oracle's PL/SQL language. PL/SQL ((for Procedural Language Extensions to SQL) is the core technology for database and application development in many of Oracle Corporation's tools. Yet it has not received the focused attention it deserves, either from training classes or reference books. This gap between the technology and supporting resources provides an opportunity for O'Reilly and Associates.

I am currently discussing publication of such a book on PL/SQL with SAMS, but I am very interested in hearing from O'Reilly and Associates about this project. I will want to move as quickly as possible on the proposal. SAMS will be sending me a contract for review by the end of the week.

I hope that you find the proposal of interest. I look forward to your response.


Steven Feuerstein

Book Proposal: A Programming Guide for Oracle PL/SQL.

Content/Structure of Book

The topic of the book is the PL/SQL programming language provided by Oracle Corporation. PL/SQL stands for "Procedural Language extensions for SQL" and is the underlying technology for complex programming in both the current and next generation of Oracle Corporation's application development and database management tools. While Oracle Corporation has produced reference manuals on PL/SQL, there are few if any books available in the marketplace which provide tips and techniques for "real world" development with PL/SQL.

The purpose of this book is to provide developers with practical strategies, tips and techniques they need to transform their formal education and training in PL/SQL into a set of skills they can use in the real world.

The underlying concept of the book is to go beyond the standard descriptions of features of the PL/SQL language and offer instead practical advice and a multitude of code samples and guides through those examples.

The major topics of the book include: overall strategies for development, coding standards, variable declarations, looping techniques, cursor management, exception handlers, character, date and number manipulation, code consolidation techniques. Readers of the book will gain both a solid understanding of the PL/SQL technology and the practical skills they need to deliver efficient and maintainable production code.

I plan to employ a multi-leveled approach to deepening one's expertise of the PL/SQL language. On the straight sequential level, I lead the reader from general strategies to coding standards to exploration of basic techniques and finally to the advanced use of these techniques, standards and stratgies to handle complex programming requirements. I also wish to have the book serve as a quick reference guide, so chapters are kept relatively short and focused on a particular topic.

With these levels, the reader watches the capacity of the PL/SQL language grow with the knowledge and skill of the developer. In addition, the reader applies the techniques learned in earlier chapters further on in the book, providing instant reinforcement. Each stage and example adds to the collection of solutions the reader has at her or his fingertips, ready to apply to a real world challenge. As a reference, the book's organization will allow the reader to quickly locate the topic and example she or he needs to meet the current, pressing need.

Whenever appropriate, I will supplement the narrative text and the code fragments with screen shots which show the PL/SQL code in the actual tool, tables and figures which provide graphical reinforcement of the text. In addition, I believe that some amount of humor is often extremely useful in improving the readability of a technical text.


This book is intended for anyone who uses PL/SQL to develop Oracle-based applications and has received at least introductory training in the language. Both beginners and more experienced users of PL/SQL will benefit from this book because many of its strategies, tips and techniques are available only from the author.

Oracle programmers generally receive only introductory training and then are left to fend for themselves when it comes to delivering efficient and maintainable production code. Existing trainings and third-party reference manuals do little more than regurgitate the contents of the Oracle Corporation documentation. On the other hand, it is widely recognized that programmers learn most effectively by example; this is especially true as regards the more complicated features of a product. Furthermore, while consultants are eager to demonstrate their expertise, they are often considerably less enthusiastic about sharing their "competitive edge" with in-house programmers.

As a result of these various factors, Oracle developers are greatly in need of resources which take them beyond the first, basic level of product understanding. They need books which can coach them with examples and the benefits of actual development experience so that they can greatly accelerate their learning curve towards a higher level of expertise.

I have worked with Oracle developers for over six years, both as a technical consultant for Oracle Corporation and as an independent consultant. I have seen over and over again that Oracle developers, no matter how competent, are unable to fully utilize their Oracle tools and achieve the maximum possible return on their significant investment in the software. More and more, this lack of sophistication is centered on the use (or mis-use) of the PL/SQL programming language.

Furthermore, as a registered subcontractor for Oracle Education, I know that Oracle itself does not even have a class for PL/SQL that goes beyond the most basic instruction and that users are hungry for this information.

Market Analysis

While I do not know enough about the volume of sales for books in the Oracle marketplace to offer a number, I believe that the potential for the sales of this book is strong precisely because:

PL/SQL is a core technology which has not yet been addressed in and of itself. As Oracle moves heavily into the client/server and GUI environment, this technology will prove ever more critical

All programmers who develop applications in any of the Oracle tools (current and next generation) must know how to use PL/SQL.

Existing trainings and books do not address the need for a deepening level of sophistication of PL/SQL programming.

In addition, I have a strong reputation within the Oracle user group community; I have been active authoring papers in user group newsletters and other publications. In addition I have presented papers at a number of conferences and also developed a utility for Oracle SQL*Forms developers for which I have over fifty customers. User awareness of an author is key to marketing a book effectively in the rapidly expanding world of Oracle developers.

Oracle is just making available widely its new Cooperative Development Environment of Windows-compliant development tools. As these products are more widely deployed, the PL/SQL component of the software will become even more critical. Finally, the full set of tools offers a confusing picture as concerns PL/SQL, since different versions of the programming language are available in different products and even within the same version, various features are disabled in some products. Developers need a book now that they can trust to guide them through this software tangle. The book should appear as soon as is possible.

Personal Qualifications

I have a bachelor's degree in mathematics and have worked as a programmer for thirteen years. I spent five years with Oracle Corporation. During and since that time, I established a reputation as a leading developer of Oracle-based applications, particularly with SQL*Forms Version 3. As the owner of ArtForms, I designed, built and currently market a debugger for SQL*Forms called XRay Vision. I have approximately fifty customers adn achieved widespread attention for this utility (a version of the debugger is made available free to all members of the International Oracle User Group via Compuserve as a membership benefit). I have been active within the Oracle user group community through the publication of articles in user group newsletters and other publications, such as the Oracle Corporation's own Oracle Integrator. In addition, I have published papers at a number of conferences, including the International Oracle User Week, and presented at both regional and national conferences, including ECO '94 in New York City in March 1994.

Saturday, March 03, 2007

A very cool mouse - and more about my ergonomic world

I probably spend upwards of 6 hours a day (and certainly sometimes more) actually sitting at my workstation, and forcing my body into unnatural positions in order to write commands to my computer.

I now go to great and any available lengths to ensure that my setup is ergonomic and doing the least damage or stress to my body.

So...I have the latest Microsoft ergonomic keyboard and I love it. I encourage all of you to make the switch from a flat, straight keyboard. It's easy to see why. Hold your hands out in front of you. Notice how they naturally turn inwards? Now straighten them out so the palms are horizontal, as they would be to type on a "normal" keyboad. Feel the stress in your wrists?

I also sit on a ball chair to minimize slouching at the keyboard, improve abdominal tone and give me the opportunity to bounce up and down while I am working. Fun!

But for my mouse, I use a standard Logitech or Microsoft contoured mouse. Nice stuff, but as I paged through one of favorite catalogues (, I came across a new sort of mouse that just immediately made sense to me: the Evoluent Vertical Mouse:

Rather than forcing my hand to go flat, I can grip the mouse in a more natural vertical fashion, and then work the buttons on the vertical face of the mouse.

It is taking some getting used to, but again it is instantly obvious that this configuration results in less stress on my wrist. Thanks Evoluent!

Friday, March 02, 2007

I love to learn from others!

I have noticed that over the years as I spend more and more of my time holding forth (teaching classes, writing, doing presentations and seminars), my listening skills have degraded. Just ask my wife.

Fortunately, however, I still listen well enough (or selectively) to be able to learn from others.

I tell people attending my courses that if they think I say something wrong, or they have another way of doing things, to speak right up. I tell students that I learn something new in every course I give, and while that isn't really entirely true, it is true enough.

Well, I learned a very, very cool technique at OPP2007, the two day conference on PL/SQL organized by ODTUG (and I was the technical co-chair). My teacher in this case was Alex Nuijten of AMIS (whose Oracle team also won the Innovation and Community Award at OPP2007!).

OPP2007 was, by the way, a really fine event and if you write PL/SQL code you should be sure to attend the next one.

So, what did I learn? A very clever way to apply AUTHID CURRENT_USER to PL/SQL subprograms.

What the heck does that mean, you might ask. Well, AUTHID CURRENT_USER is a clause you can add to the header of your program (in the ZBI, as Bryn Llewellyn PL/SQL Product Manager, described it at OPP2007: the Zone Before the Is). It tells Oracle that when you run the program, any references to data objects (tables, views, etc.) should be resolved according to the privileges of the currently connected schema (the "invoker"), and not the owner of the program (the "definer"). That's why this feature is called "invoker rights."

But invoker rights only applies to data objects. If in your application, program A calls program B, and at the time of compilatoin B is resolved to be "APPDEV.B", then when you run A, it will call APPDEV.B, even if A is defined as AUTHID CURRENT_USER and you have your own program B in your schema.

Sorry, I know that was a rather dense explanation, but it is now 10:30 PM, I am sitting in the Admiral's Club business center at the San Fran airport, and I am tired. So that is all the explanation you get. The code below, however, should straighten things out for you.

So that's the problem: invoker rights doesn't affect the call stack of your programs.

Or does it?

The very cool technique that Alex shared during his excellent talk, Design Patterns in PL/SQL, is that you can use dynamic PL/SQL block execution to achieve the desired effect.

You can see this quite easily by running the following sequence of statements. Note that it assumes you have both the HR and SCOTT schemas present.


DBMS_OUTPUT.put_line ('HR!');
END show_user;

END show_user_dynamic;

GRANT EXECUTE ON show_user_dynamic TO scott
GRANT EXECUTE ON show_user TO scott
CONNECT scott/tiger
SET serveroutput on

DBMS_OUTPUT.put_line ('SCOTT!');
END show_user;


After running this code you should see three lines of output:


And what it reveals is that when I call a program inside a dynamic PL/SQL block, then the invoker rights mechanism is applied to the "SQL" statement, and the reference to my program is resolved at runtime according to the privileges of the currently connected schema.