Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 2993

Missing Indentation on data load

$
0
0
I have a requirement to load groovy expressions to oracle database using liquibase. I am able to do this with loadData tag as given below. But I have a issue with groovy script indentation. After data load the groovy script indentation was missing and It causes a RunTime Exception. Please let me know how to maintain indentation while data load.

<changeSet author="build" id="v3"  runOnChange="true">
<loadData tableName="RRC"
file="changelog/v3.0/lib/rrc.dsv"
separator="|"
quotchar="~" >
</loadData>
</changeSet>

Sample rrc.dev file:
~ID~|~EXPRESSION~|~TYPE~
1|~evaluate Matched using {
// Map Group
def result = lookup "PRO_CODE", using $TABLE
if (result) {
// Use ASC Code to lookup appropriate rate, if not found line will not be priced
def rate = lookup "CODE", result.CODE using $TABLE
if (rate) {
Amount = rate.RATE
}
}
// If use default pricing
else {
Amount = Charges * $PERCENT
}
}~|~FEE_SCHEDULE

After data load the groovy expression is like below:
evaluate Matched using {
// Map Group
def result = lookup "PRO_CODE", using $TABLE
if (result) {
// Use ASC Code to lookup appropriate rate, if not found line will not be priced
def rate = lookup "CODE", result.CODE using $TABLE
if (rate) {
Amount = rate.RATE
}
}
// If Procedure Code cannot be mapped, use default pricing
else {
Amount = Charges * $PERCENT
}
}

Viewing all articles
Browse latest Browse all 2993

Trending Articles