Script to read multi line MySQL Query to single string variable
When using MySQL Queries that are read from text files, AA requires the Queries to be a single line in order to be read from text and then assigned to variable.
Example: Variable = SELECT * FROM DATA.TABLE WHERE VALUE = X
This format is fine for a small query, but when using a query that is 80+ lines long the resulting query in a single line string is very difficult to read and work with.
Is it possible to write a script that would read a formatted text file and convert it to a single string that would be recognized by AA? By formatted I only mean that the text file has lines terminated by a CR & LF but is still in plain text format.
Example: Select * from DATA.TABLE
WHERE VALUE = X
And convert those two lines (or any number of lines) in to a single string?
I would think this is possible with VB Script by stripping out the CR & LF characters and replacing them with a space. I don't know how to write the script but I do appreciate any help that can be offered. Thank you.
|