Current Text to Global Variable ?

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

othni
Posts: 34
Joined: Tue Mar 01, 2005 1:47 am
Location: San Juan, Puerto Rico
Contact:

Current Text to Global Variable ?

Postby othni » Fri Apr 11, 2008 8:30 am

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

User avatar
DataMystic Support
Site Admin
Posts: 2164
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Postby DataMystic Support » Fri Apr 11, 2008 10:01 am

Drag the Capture Filter as a subfilter of the Replace filter.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

othni
Posts: 34
Joined: Tue Mar 01, 2005 1:47 am
Location: San Juan, Puerto Rico
Contact:

Postby othni » Fri Apr 11, 2008 11:35 am

Thank you , I will try it tomorrow!

othni
Posts: 34
Joined: Tue Mar 01, 2005 1:47 am
Location: San Juan, Puerto Rico
Contact:

Postby othni » Sat Apr 12, 2008 12:25 am

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.

othni
Posts: 34
Joined: Tue Mar 01, 2005 1:47 am
Location: San Juan, Puerto Rico
Contact:

Postby othni » Sat Apr 12, 2008 6:31 am

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.


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 9 guests