The beginning of knowledge is the discovery of something we do not understand. [Frank Herbert]

Menu

I seem to be suffering from a blogging block (like a writers block, but for a blogger). Maybe it’s my new job at AMIS or the new application at the KPN I am working on. It’s a lot of figuring out what is going on. Reading through other peoples code and try to understand their mind setting and the path they followed.

It did however teach me new usage of SQL, for instance the WITH clause which can be used instead of inline views and I recently came across a use of the update statement I didn’t know of.

And if you wanted to update two columns, just add another update statement:

update emp a
set sal = sal *1.5;

But, if you would want to update a lot of columns this would involve a lot of statements, hence a lot of round trips to the database. Since I am a PL/SQL guy, I think I would have written a small loop to accomplish the same result:

All of these examples result in the same outcome, but one takes more time than the other. Depending on the calculations that need to done on the columns you might choose to do this is SQL or in PLSQL. I think most of the real world issues can be solved by just using the SQL approach, but as you can see, there are more ways to solve a problem.