Automation. selecting records based on a result set variable

Hi,

Apologies if this has been asked already in a previous post.

I’m trying to Automation a script that does the following

Queries a table and saves the results into a Result Set variable called ‘Test’

E.g.

Result Set variable may contain the following values

1234
2345
3456

Now I want to use the variable called ‘Test’ as part of an ‘in’ statement

e.g.

select * from table
where
columnvalue in
(

)
;

I can see that you can use a normal variable and do a find and replace to insert it into a script but I don’t appear to be able to do the same with a ‘result set’ variable.

I’ve tried using a loop dataset object but I think this is more for processing indivual records for things like sending emails based on the values in a record.

I just want to use my ‘result set’ variable as part of a sub select in another query.

Any help would be much appreciated.

Cheers,

Dean