Table: SerialPorts
Code: Select all
PortID PortName PortStatus
1 COM1: Open
2 COM2: Closed
Code: Select all
put "SELECT PortID FROM SerialPorts WHERE PortStatus='Open'" into SQLquery
put revDataFromQuery(,,ConnectionID,SQLquery) into QueryResults
Code: Select all
put "SELECT PortID, PortName FROM SerialPorts WHERE PortStatus='Open'" into SQLquery
put revDataFromQuery(,,ConnectionID,SQLquery) into QueryResults
UPDATE: I am passing the SQL as a parameter to another handler that actually calls the database. The comma caused the SQL to get interpreted as two parameters. So I changed the , to ~ and do a quick replace before executing the query and this works.
Code: Select all
put "SELECT PortID~PortName FROM SerialPorts WHERE PortStatus='Open'" into SQLquery
send "DBsearch" && SQLquery to stack "TCS"
put the result into QueryResults
on DBsearch SQLquery
...
put revDataFromQuery(,,ConnectionID,replaceText(SQLquery,"~",",")) into QueryResults
...
return QueryResults
end DBsearch
thanks,
Mike
Stitch_Fan