Skip to main content


Appreciation for Those Who Give of Themselves (#ThanksOGB)

My #ThanksOGB post:

I've been working - and personally benefiting from - Oracle Database technology since 1987. I joined Oracle as a pre-sales consultant, which meant back then I was a techie sidekick for one or more Oracle salespeople. I moved on to various other roles and in 1992 left to become a consultant. Two years later, wrote a book on PL/SQL and have been obsessed with that language ever since. In 1999, I released the first version of utPLSQL - unit test for PLSQL, my version of JUnit. Worked for Quest for many years (bringing Quest Code Tester for Oracle to the market, among other things), and in 2014 rejoined Oracle, where I now lead a team of developer advocates (Blaine Carter, Chris Saxon, Connor McDonald, Dan McGhan).

It's been a great life - and I expect it to keep on being such for a while to come. Part of the point of my little historical review, though, is that I was always paid to provide resources to the community (some of them free, like utPLSQL and my man…
Recent posts

Using Object Types in Relational Tables, Part 4

So far in my series on object-oriented development in Oracle Database, all manipulation of object type instances have taken place in PL/SQL.

But as you may have guessed from the fact that you "CREATE OR REPLACE" object types, those types are also available for us in SQL. You can create relational tables of object types, called object tables. You can also define columns of relational tables whose datatypes are object types.

In this post, I will explore both of these approaches. All the code you see below may be found in this LiveSQL script, so you can get to know these features by playing around with them yourself.
Object Tables It's easy to create object tables and work with the instances in those tables (both selecting and changing rows of data). Here's a simple example:
CREATE TYPE food_ot AS OBJECT ( name VARCHAR2 (100), food_group VARCHAR2 (50), grown_in VARCHAR2 (100) ) NOT FINAL / CREATE TABLE food_table OF food_ot (CONSTRAINT food_table_pk PRIMA…

Using Always Free Autonomous Database to help me heal our planet

So I signed up for my Always Free Autonomous Database (AFAD) and a boatload of other cloud services. OK, what shall I do with them? some of you may know, I've gotten very concerned about climate change and human-caused extinctions. I started a project with Vincent Morneau called fabe - for all a beautiful earth - to help all of us reduce consumption, rescue species and reconnect to nature. Check it out at Yes, it is an APEX application and it is already running on an Oracle Database cloud service, so....what else?

You know the saying "think globally, act locally"? Well, if fabe is global, then my work on invasive species is local, very local.

When I lived in Chicago, I went out to the nearest "wild" spaces I could find and cut back buckthorn trees that didn't belong in Chicago, out-competed native trees for sunlight, and killed off those native species. I rescued trees - and the literally millions of living creatures t…

Always Free Autonomous Oracle Database: Let's get going!

On September 16, Larry Ellison announced a new Always Free tier for Oracle Cloud, which (for me) most importantly includes an Always Free Autonomous Oracle Database.

For nothing but the "cost" of providing your credit card information (which is only used for identification purposes and is henceforth ignored until you decide to upgrade to a paid service), everyone in the world now can use the most powerful, most advanced database in the world FOR FREE.

Of course, there are limits. But oh my what generous limits they are!

Get lots more details here.

And it's not just the amazing Autonomous Database (in both transaction processing and data warehouse flavors).

You get Oracle Application Express (APEX) so you can build websites writing very little code, and taking full advantage of your SQL and PL/SQL skills.

You get SQL Developer to write what code you need and manage your database.

You get Oracle Rest Data Services to build REST endpoints against your database.

And if you …

Object Types and Object-Oriented Development with PL/SQL: the Series

Find below the list of my blog posts in a series on working with object types (a.k.a, classes) in Oracle Database and, specifically, PL/SQL.

This series is not intended to offer an in-depth training on object-oriented development; instead, it introduces basic O-O concepts and shows how they are implemented in Oracle Database with PL/SQL.

Introduction to Object Types, Part 1
Object Types and Inheritance, Part 2
Object Types Methods, Part 3
Using Object Types in Relational Tables, Part 4

Each post also contains a link to a LiveSQL script, so you can try out all the code yourself.

Still to come:

Comparison Methods, Part 5
Dynamic Polymorphism, Part 6

Object Type Methods, Part 3

Packages have subprograms (procedures and functions). Object types have methods.

Object type methods are, still, procedures and functions. But there are also different types and characteristics of methods that only make sense in an object type, which supports inheritance and dynamic polymorphism.

In this post, 3rd in my series on object types, I explore
Static methods Member methods Non-instantiable methods Invoking methods of super types All the code you see below can be run in Oracle LiveSQL through this script. Member Methods Member methods are methods applied to an instance of the type. Almost all the methods you ever write for an object type will be a member method. Assuming you are already familiar with writing PL/SQL functions and procedures, the most important thing to come up to speed on is the SELF value.

Member methods have a built-in (implicit) parameter named SELF that denotes the object instance currently invoking the method.

We'll explore member methods, including a…

Object Types and Inheritance, Part 2

In my first post on object-oriented programming in PL/SQL, I introduced the object type (our version of a class) and showed how you needed to instantiate an object type instance before you could work with it.

In this post, I explore how to create a hierarchy of types. Type or class hierarchies are a key concept in object-oriented programming, because of the way that subtypes inherit attributes and methods from their parent types. All the code you see below can be run in Oracle LiveSQL through this script.

Let's revisit the root type of my hierarchy: food.
CREATE TYPE food_ot AS OBJECT ( name VARCHAR2(100), food_group VARCHAR2 (50), grown_in VARCHAR2 (100) ) NOT FINAL ; A very simple type: it contains just three attributes and no methods (procedures or functions). It also contains the NOT FINAL clause. This means, rather obviously, that I am "not done." What that means in the context of object types is that I might want to create a subtype of …