Recreate variables

nicofari

Member²
Is there any method to re-parse the SQL and re-create the variables at runtime?
I believed it exists, but now I am unable to
find it....
Thanks in advance
Bye
nicola
 
I'm not sure what the question is, but you can do everything at runtime. You can declare variables through DeclareVariable.

There should not be any reason to reparse the SQL. If the SQL.Text changes, it will be reparsed automaically.

If this does not answer your question, let me know.

------------------
Marco Kalter
Allround Automations
 
What we were looking for is the possibility you have in the property editor of TVariables at runtime where you could scan the query for all variables it contains.
 
To find bind variables in a piece of SQL, you can use the FindVariables function in the Oracle unit:

function FindVariables(const SQL: string; IncludeDuplicates: Boolean): TStringList;

The SQL parameter is the SQL you want to analyze. If a bind variable appears more than once in the SQL, the IncludeDuplicates parameter controls if it also appears more than once in the result. The result is a TStringList instance (which you must free later). The Objects property of the result contains and integer value that indicates the position in the SQL where the corresponding variable is located.

------------------
Marco Kalter
Allround Automations
 
Back
Top