Call procedure in groovy

sql = new Sql(dataSource_nss)


println"After Datasource"


def stmt = "BEGIN PKG_REFLOAD_SOURCE.PRC_VALIDATE_INSERT_SOURCE(?,?,?,?,?); END;" 

def params = [
itemName,
ItemtId,
user,
Sql.NUMERIC,
Sql.resultSet(OracleTypes.CURSOR)
]


sql.call (stmt, params) { status,errors ->

if(status==1){
errors.eachRow(){
def erroObj
erroObj = [
field:errors[0],
desc:errors[1]
]
println" error value record :"+erroObj
lstErrors << erroObj
}
}
}



Comments

Popular posts from this blog

Conversion from Clob To String in java and Vice versa

Portable Java 8/ JDK8 setup without admin rights

Multi Threading , Producer consumer problem in Java