Loading...

Tag Archives: 11gR1

Compound triggers and mutating tables

Source: trigger.sql
If you are in a mutating table situation where your trigger needs to read from the same table that it is firing on your only real option before Oracle 11g was a multi trigger solution with a muddle of row and statement triggers communicating via a package. But now Oracle 11g comes through [...]

Weekly Transaction Report 2

I had hoped to come up with a neater version of my Weekly Transaction report using the new PIVOT function in Oracle 11g but I wasn’t able to come up with anything much better primarily due to:

ORA-56901: non-constant expression is not allowed for pivot|unpivot values

So let’s take a look at the revised version of the [...]

Bind Variables

The performance benefits of using BIND variables are easily illustrated with simple thought experiment. In your language of choice write a complete SQL parser which also analyses statistics and comes up with an execution plan. Ready? Go! Now how long does that parser take to tokenize the queries? Parsing and [...]

MIN and MAX together = bad execution plan

To demonstrate the MIN and MAX functions let’s create a global temporary table with an index and then add some data to the table. Note that you must create indexes on temporary tables when they are empty so you’ll have to TRUNCATE the table if there is anything in it. Let’s create the [...]