Hi,
how can I change a SQL by a selection of a list?
In my Example I select in a Combo Box the Line ({"AL1", "AL2", "AL3", "FTA", "FTB", "FTC"}) and then I like to change my SQL with my selction. Currently I have "WHERE (t1.tag LIKE '%AL2%' ) ". And that works. But I like to substitute "AL2" regarding my selection.
Can anybody help me?
a = {"AL1", "AL2", "AL3", "FTA", "FTB", "FTC"};
New Window( "Line",
<<Modal,
H List Box(
Panel Box( "Select a Line:",
cb1 = Combo Box(
a,
<<SetFunction(
Function( {this},
selection = this << Get Selected();
)
),
)
)));
show (selection);
New SQL Query(
Version( 130 ),
Connection(
"ODBC:DRIVER"
),
QueryName( "pisnapshot" ),
CustomSQL(
"SELECT t1.tag
FROM pisnapshot t1
WHERE ( ( ( (t1.tag LIKE '%AL2%' ) ) ) )"
),
PostQueryScript(
"dt = Current Data table ();
TagList = Column (dt, 1) << Get Values"
)
) << run foreground;