SQL Query in Input Dialog with Choice


I’m trying to output a SQL query in a input dialog. My idea was as soon as the SQL query finds this data in a input dialog with each other. In the dialog field I would like to select via an option switch which data set the robot should process.
How about the right approach? Save all data in an array and then read out?