Extracting XML from Oracle XMLType using XPath

May 4, 2016

I wanted to extract some XML from a column in a table. The column was of type XMLType, and the XML that was within it had a Namespace in it.

INSERT INTO drumcoder values ('<fred xmlns="drum"><joe>456</joe></fred>');

The value of the joe tag (456) can be ...

Oracle LAG Function

April 26, 2016

I wanted to refer to the previous row in a query and to do some maths to see the difference in the current row's date from the previous row's date.

This can be done with the Oracle LAG function:

SELECT sch_header, sch_date, sch_number, sch_date - lag(sch_date, 1) OVER ...

REST Guidelines

April 25, 2016

I found an interesting set of REST service guidelines at http://blog.octo.com/wp-content/uploads/2014/12/OCTO-Refcard_API_Design_EN_3.0.pdf


March 5, 2016

I have a website that allows download of a zip file. This zip file is created on the fly, and by using the Content-Disposition header I can determine the filename it is saved as.

This particular download worked in Firefox but not in Chrome. It turns out that Chrome has ...

Migrations not working with Postgis

February 21, 2016

./manage.py migrate was giving me the following error:

django.db.utils.OperationalError: could not open extension control file "/usr/share/postgresql/9.1/extension/postgis.control":
No such file or directory

I'm on Debian, and most of the solutions suggest installing a scripts package that isn't there ...