You can do this if with the next bit of pseudocode, from your application code
sqlexecuter.run( "CREATE TEMPORARY TABLE ORDERED_ENTRIES( ORDER_ENTRY NOT NULL AUTO_INCREMENT PRIMARY KEY, PRODUCT_NAME varchar(255)
Then in your code paste them into this table, similar to this
for(i:lenght(myProductArray)) sqlexecuter.run (" INSERT INTO ORDERED_ENTRIES VALUES("+myProductArray[i]+")" )
And then select this
sqlexecuter.select( " SELECT OE.ORDER_ENTRY, PT.PRODUCT_NAME FROM PRODUCT_TABLE AS PT, ORDERED_ENTRIES AS OE WHERE OE.PRODUCT_NAME = PT.PRODUCT_NAME ORDER BY OE.ORDER_ENTRY ");
source share