PostgreSQL With Docker – Quick Start

Introduction

Docker is changing how we distribute and install software and it is a very popular tool in many areas of software development as well. In this post, I will show you how to quickly get started with docker and PostgreSQL.

I will try to keep this post very simple and will not cover complex workflows (those will be covered in later posts) and this will keep the discussion focus and help in easy learning. Now the idea is that you are gonna get, I don’t know, lights up the old neurons and creates one of those aha moments.

Comparison Methods for Object Types, Part 5

There are special member methods — map or order methods — that we use to tell Oracle Database how to compare two objects of the same datatype. This capability is critical when we want to perform an equality test in PL/SQL or when sorting objects in SQL.

You may also like:  Object-Oriented JavaScript

There is no default way to do this. In other words, if I create a simple object type, add it as a column to a table, and try to compare or sort, all I get are errors. Let's take a look. First I will create a table that has an object type as a column and add a couple of rows.

Introduction to Object Types (a.k.a. Classes) Part 1

Object types (classes)

PL/SQL is a procedural language — mostly. But it can also be used to implement object-oriented features in Oracle Database. In "from the ground up" object-oriented languages like Java, everything is defined in classes. In Oracle Database, we have object types.

In this post, I introduce you to the basics of object types and kick off a series exploring many of the features of these programming elements.

PL/SQL — Don’t Mix and Match Scope

In this article, we find out why you shouldn't mix and match scope. Here's a simple little PL/SQL block where we call an inner procedure PARAMETER_TESTER from its parent block. Pay particular attention to the parameter we pass to the procedure and its value throughout the execution of that procedure.

SQL> set serverout on
SQL> declare
  2
  3     glob_var  int := 0;
  4     local_var int;
  5
  6     procedure PARAMETER_TESTER(param int) is
  7     begin
  8         dbms_output.put_line('Param came in as: '||param);
  9         glob_var := glob_var + 1;
 10         dbms_output.put_line('Param left as   : '||param);
 11         dbms_output.put_line('glob_var is now : '||glob_var);
 12     end;
 13
 14  begin
 15     parameter_tester(100);
 16  end;
 17  /
Param came in as: 100
Param left as   : 100
glob_var is now : 1

PL/SQL procedure successfully completed.

Now I'll slowly extend the code, and just by eyeballing it, see if you can predict what the output will be before looking past the end of the PL/SQL block.

APEX_COLLECTION: APEX’s Super Power!

Apex Collections (APEX_COLLECTION) is a package that comes with Oracle Apex and is one of the most important features that comes with Oracle APEX. It can be used in many ways for different purposes, but in general, you can think of Apex Collection as a temporary space to store complex data Types — non-scalar — for instance, full row of data from a table or a view (When you work with Apex Temporary table is not a real option). This data can be manipulated in any way and then stored in Table(s). Each Apex Collection can can has 50 varchar2 attributes (c001 -> c0050), 5 number Attributes (n001->n005), 5 date attributes (d001->d005), 1 CLOB attribute (clob001), and 1 BLOB Attribute (blob001). Each member has a sequence number and each collection must have a unique name.

In this tutorial, I will build a collection from the data stored in a table, add more rows from the table to the existing collection, and then I will show you how to add new member to the collection, how to edit a Member, how to delete a member, and how to save the collection back to the table. I will use some simple Dynamic SQL, and we will use dynamic actions too (many of them actually!).

Super Dynamic APEX Forms Using APEX_ITEM and Dynamic Actions

Working with forms in Oracle APEX is really easy and even fun thanks to the improved wizard that can create a form page on any table, view, or even on a web source in a few simple and clear steps. But sometimes you'll need to enter multiple 'rows' at once. In most of these cases, you will not know how many items or rows the user will need to enter until run time, so the user may want to enter one row or 10 rows, and sometimes the user will enter zero rows of this specific type. So the question now is how can you, as a developer, build a 'dynamic form', a form that accepts multiple rows that can change in size according to the user's wish?

The answer is APEX_ITEM package + APEX's dynamic actions. Using this mix, you can build a very dynamic, powerful form on any page of your application. APEX_ITEM is a package that, according to Oracle's formal definition, is used to "create form elements dynamically based on a SQL query instead of creating individual items page by page." So basically, it gives the developer the ability to create items dynamically, and from these items, a form can be built. APEX_ITEM offers a list of item types: text box, text area, LOV (list of values), date popup, etc. For details, see Oracle's reference.