Page 1 of 1
Current Text to Global Variable ?
Posted: Fri Apr 11, 2008 8:30 am
by othni
I execute some SQL select commands that outputs a single value. It is just a word with some spaces. I use a Replace filter to trim the trailing spaces.
I need to declare that value (or word) as a Global Variable.
I see there is the Capture to Variable filter. But do not know a way to set it as just the resulting text at that step within the filter.
Thank you
Posted: Fri Apr 11, 2008 10:01 am
by DataMystic Support
Drag the Capture Filter as a subfilter of the Replace filter.
Posted: Fri Apr 11, 2008 11:35 am
by othni
Thank you , I will try it tomorrow!
Posted: Sat Apr 12, 2008 12:25 am
by othni
I could not make it work.
I am using the Add File Header filter and using the @variable but it does not translate to the variable. It translate to blank.
Posted: Sat Apr 12, 2008 6:31 am
by othni
Ok, I made it!
Instead of using the Capture Text filter aproach, I used a Perl Pattern Replace filter to find the first line of the current input text and asigned it to a Named Variable. I replaced it with nothing. Then I added an Add Header filter as a subfilter with the SQL Select statement with references to the @named_variable.
Then the SQL Connection was next at the end to execute it.
It took me a while, but it is working.
Thank you.