Nesting ODI Substitution Methods. Part II.
Get our e-books Discover the Oracle Data Integrator 11g Repository Data Model and Oracle Data Integrator Snippets and Recipes
Today we look at how we can escape quotes when nesting ODI substitution method calls at different levels of the multi pass parser.
As an example we will store the columns of the C$_ datastore and the columns of a target datastore in a two dimensional java array.
1 2 3 4 5 6 7 8 |
<? String[][] ColList = {<%=snpRef.getColList("{", "u0022[EXPRESSION]u0022", ",", "}","INS")%>,<%=snpRef.getColList("{", "u0022[COL_NAME]u0022", ",", "}", "INS")%>}; for (int i = 0; i < ColList.length; i++) { for (int j = 0; j < ColList[i].length; j++) { out.println(ColList[i][j]); } } ?> |
As you can see, we are nesting a call to the ODI substitution API inside aparse block. Normally in Java we escape a quote with “. In ODI this would throw an error. What we do instead is to use the Unicode representation of the quote character: u0022
If you want to master scripting in ODI get the following books.
Java BeanShell
Scripting in Java: Languages, Frameworks, and Patterns
Jython
The Definitive Guide to Jython: Python for the Java Platform.
Jython Essentials (O’Reilly Scripting)