5

I have the variable total_lines on a jython command that I needs to be accessed on the refreshing command of a ODI variable.

with open('file.txt') as file_name:
        for total_lines, line in enumerate(file_name):
            pass
        print total_lines
total_lines += 1

For this I thought of passing it through a Java Beanshell variable using <@ @>. Like so: in the jython command:

<@int totallines = total_lines; @>

in the refreshing command:

select '<@=totallines@>' from dual;

Is this possible? How can I attribute a jython variable to a beanshell variable? What are my alternatives?

Cheers

Afonso
  • 407
  • 1
  • 5
  • 16

1 Answers1

0

I think you must execute the first calculation of your variable with java bean shell inside tags

<@ for ... totallines += 1 ... @>

instead of Jython. Then, your refreshing command will work.

skrtbhtngr
  • 2,076
  • 20
  • 28
dba
  • 1