ODI – getSession("SESS_PARAMS" )

Uli Bethke

Uli has been rocking the data world since 2001. As the Co-founder of Sonra, the data liberation company, he’s on a mission to set data free. Uli doesn’t just talk the talk—he writes the books, leads the communities, and takes the stage as a conference speaker.

Any questions or comments for Uli? Connect with him on LinkedIn.


Published on March 17, 2010
Updated on November 20, 2024

Get our e-books Discover the Oracle Data Integrator 11g Repository Data Model and Oracle Data Integrator Snippets and Recipes
In response to my article on the ODI variable debug procedure Craig Stewart has pointed out an undocumented parameter of the getSession method that does the same with one big limitation.
The parameter SESS_PARAMS will print out any variables that have been passed into a scenario generated from a package. Unfortunately this is the limitation of this method. Variables that you dynamically assign inside the package will not print out to the Operator. The reason for this is the inner workings of the ODI multi-pass parser. Basically, ODI prints out the parsed command text of your procedure, interface etc. to the Operator before it assigns a value to a variable. As a result this value only becomes available at execution time and we need to force a printout by raising an execption.
Anyway, let’s try out Craig’s suggestion. I will adapt the debug procedure from the previous article and include the following command:
odi_sess_params1
Next we generate a scenario from this package and encapsulate this inside a parent package and pass in a value for the v_raise variable
odi_sess_params2
Let’s verify that the value was printed out in the Operator Module.
odi_sess_params3
This is very neat and works because we pass the value into our child scenario and as a result the value of the variable is already available before ODI writes out to the Operator module.
Thanks to Craig for sharing this information with us.
In order to master scripting in ODI I recommend 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)

Uli Bethke

About the author:

Uli Bethke

Co-founder of Sonra

Uli has been rocking the data world since 2001. As the Co-founder of Sonra, the data liberation company, he’s on a mission to set data free. Uli doesn’t just talk the talk—he writes the books, leads the communities, and takes the stage as a conference speaker.

Any questions or comments for Uli? Connect with him on LinkedIn.