23 December 2010

Should you expose a Stored Procedure via XMLType?

When you want to expose your Stored Procedure to the "outside world", should you do this using XMLType? As always, the correct answer is "it depends".
For this example I will use a Package containing two functions, the signature of the package is as follows:

create or replace package emps_pkg
function get_department_xml (p_department_no in number)
return xmltype;

function get_departement_ot (p_department_no in number)
return all_departments_ot;

end emps_pkg;

Creating an XMLType based on Object Types

Sometimes it is necessary to create a Stored Procedure which returns an XMLType, like when you want to expose the Stored Procedure to the "outside world", like via a Mediator. There are several options to create an XMLType. In this blogpost I will show you two ways of doing this. First the "regular" way using XMLElement, XMLForest and XMLAgg. Second using Object Types which are being converted to XMLType.

20 December 2010

Using DBMS_UTILITY to aggregate strings

In my presentation "Analytic Functions Revisited" there is a section on how to string together some columns, string aggregation. Why? There is a new function in Oracle 11g Release 2, called LISTAGG which allows you to do this. This LISTAGG function also has an Analytic counterpart and that's the reason it is in the presentation.
At the UKOUG TEBS conference I did this presentation and someone approached me after wards to talk about these techniques. It boiled down to "Why do it the hard way when there is a built in package that allows you to do this for you?"
The built in package he was referring to is, note the title of this blog entry, DBMS_UTILITY. There are some downsides of using DBMS_UTILITY, more than I initially thought.

16 December 2010

My First UKOUG - day two and three

Why can I never find the time to write my blogs?... Anyway, long overdue, here is my report from my first UKOUG conference. If you want to know what I did the first day, check out this link.
As I mentioned before the program is awesome, lots of very good speakers and very interesting subjects. It's quite hard to pick and choose the sessions. So what did I do the second and third day there?

06 December 2010

My First UKOUG - day one

Last week the UKOUG-TEBS conference was in Birmingham. For whatever reason I had the idea that this conference was fairly small - no idea why I thought that.
The conference was held in the ICC in Birmingham, a wonderful location.