Since you haven't provided much information on how your data is organized, I made a simple example that can achieve what you want.
LOAD * Inline
Where Reserved = 'Y';
drop table Sample;
if (NoOfRows('ConnectODBC') = 1) then
trace Only 1 Row selected.;
let vConnectString = peek('ConnectionString',0,'ConnectODBC');
trace Connection String: $(vConnectString);
trace(Multiple Rows selected, no connection made!!!);
The above code can get the connection string only if one condition is met.