Skip to content

Instantly share code, notes, and snippets.

select * from (
select 'GENERAL' Module, GURVERS_RELEASE Version, GURVERS_STAGE_DATE Installed, '' Comments
from GURVERS
union
select 'ACCOUNTS RECEIVABLE' Module, TURVERS_RELEASE Version, TURVERS_STAGE_DATE Installed, '' Comments
from TURVERS
union
select 'STUDENT' Module, SURVERS_RELEASE Version, SURVERS_STAGE_DATE Installed, '' Comments
from SURVERS
union
@jdkane3
jdkane3 / Base64.groovy
Created January 28, 2016 13:45
Simple groovy example of encoding and decoding a string in Base 64
def s = 'Argh, Groovy you say, mate?'
def b64 = s.bytes.encodeBase64().toString()
def bytes = b64.decodeBase64()
def decodedData = new String(bytes)
println s
println b64
@jdkane3
jdkane3 / XslTransform.groovy
Created January 28, 2016 13:50
Simple groovy XSLT code
import javax.xml.transform.TransformerFactory
import javax.xml.transform.stream.StreamResult
import javax.xml.transform.stream.StreamSource
// Load xslt
def xslt= new File("MyTrasform.xsl").getText()
// Create transformer
def transformer = TransformerFactory.newInstance().newTransformer(new StreamSource(new StringReader(xslt)))
@jdkane3
jdkane3 / XeSequenceCheck.sql
Created February 3, 2016 20:40
Anonymous Banner procedure to check XE surrogate ids against their sequence for issues.
DECLARE
/*
Banner XE Sequence Checker
This procedure checks all tables in the given schema for the condition where
the surrogate id sequence lags the maximum surrogate id. This situation will
eventually cause inserts into the table to fail with an unique constraint
violation on the surrogate id.
This condition comes about when data rows are copied from one region to another
DECLARE
/*
Banner XE Sequence Fixer (also see Banner XE Sequence Checker)
This procedure attempts to fix the situation where a Banner SURROGATE_ID_SEQUENCE
gets behind the max SURROGATE_ID that it creates values for.
We fix it by selecting the sequence nextval in a loop until it's greater
than the surrogate ID.
This situation can happen when data rows are copied from one region to another