Change static data from to Variable in SQL Query

Hi Everyone,

I have a query and i want to change the static value into variable so that the value to find is dynamic. See the attached screenshot for reference.

Thank you.

hi, @rpaforum

Write the query in Execute Query like this (example using a parameter)

SELECT TOP 1 [fld_TransactionID],
       [fld_AccountNo],
       ...
FROM [db_CebXpresseWallet].[dbo].[tbl_EMoneyTransactions]
WHERE [fld_ControlNo] = @ControlNo
  AND [fld_AccountNo] <> 'X0000000005-04'
ORDER BY [fld_DateCreated] DESC

Then in the Execute Query activity:

  • Open Parameters.
  • Add an In parameter named ControlNo.
  • Set its Value to your UiPath variable, e.g. strControlNo.
    This way, whatever value is in strControlNo is used in place of the static ‘EMMKM113757264’ every run.

Hi @rpaforum

Welcome to UiPath,

Pls follow the below thread:

happy automation

hi @arjun.shiroya, it worked! thank you for the help! :smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.