Skip to content

Instantly share code, notes, and snippets.

View peter-genesys's full-sized avatar

peter-genesys

  • Brisbane, Australia
View GitHub Profile
@peter-genesys
peter-genesys / CLOBlist.sql
Created August 20, 2018 07:09
CLOBlist - CLOB list aggregation function for SQL. Similar to LISTAGG, but simpler syntax, and can suppress duplicates.
------------------------------------------------------------------
-- Program : CLOBlist
-- Name : CLOB list
-- Author : Peter Burgess
-- Purpose : CLOB list aggregation function for SQL
-- RETURNS CLOB - to allow for more than 4000 chars to be returned by SQL
-- NEW type CLOBlistParam - allows for definition of the delimiter, and initiator of sequence
------------------------------------------------------------------
--This is an aggregating function for use in SQL.
--It takes the argument and creates a comma delimited list of each instance.