Author Archives: ed@lakenine.com

Calculating Time Spans Between Rows in Oracle

Oracle’s analytic functions are great for summarizing data, but that’s only part of their power. The LEAD and LAG analytic functions let you work with values from preceding or following rows, something that’s difficult – and often impossible – to do with non-analytic queries.

This post shows how to use the LAG function to calculate time spans between events in a log file. Continue reading

Raw XML Web Service Calls in C#

This is a companion article to Reading XML with Namespaces using LINQ, which explains how to parse XML with namespaces. Both articles came about because I had to use a web service that had non-standard envelope headers, and after struggling with the configuration settings and the sparse Windows Communication Foundation (WCF) documentation for creating custom headers, I finally threw it in and called the service by brute force – assembling the HTTP and XML requests, calling the service, and parsing the returned XML response.

I want to stress that WCF is excellent for communicating with a web service that more or less uses SOAP standards. If that’s your situation, stop reading right now and use WCF. But if you run into trouble with non-standard services I think it’s easier to put WCF aside and work directly with the service. At the very least, it’s a lot more straightforward. Continue reading