Avatar

Community Advisor

Hi @akashaj7696 - I have tried to do this and I found that its easier to write back to another schema than the one you are querying in the queryDef. You can then query the temporary table later in the workflow.

I could never get the xtk.session.Write() function to actually work correctly so I used sqlExec() instead. Be careful if you are using user-input values as its not database-safe doing direct DB writes, so you should sanitize the inputs.

Also, the write operation seems to affect the cursor in the query operation when you need to page the query (i.e. >10000 results). It works fine if you never need to page the query.

There is some more info here:  https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/advanced-workflow-...

Cheers

Darren