2012-12-23

Building Comma Separated Values with Oracle & SQL

From time to time I’m asked to aggregate strings from multiple records into a single column using SQL. Here’s an example, showing a comma-separated list of ordered employee names per department based on the famous EMP and DEPT tables. Oracle introduced the aggregate function LISTAGG for that purpose in 11.2. If you […]
2011-10-12

Using UTL_XML.PARSEQUERY for SQL Dependency Analysis

Last week I had a talk at Oracle’s OpenWorld 2011 titled Modern PL/SQL Code Checking and Dependency Analysis. The problem I described in chapter 4 was to find all view columns using the column UNIT_COST of the table COSTS in the SH schema. Other usages of this column (e.g. in where or […]