Need help to convert SQL query to Uipath Executable query

Hi,

Can anyone help me to change the below query to Uipath executable query. That would be helpful. Thanks in advance.

SELECT DISTINCT eb.Name,
eb.createdby,
ss.username,
eb.createddate,
eb.createdtime,
eb.pmtmethodgrpstatus AS Status,
eb.pmttype,
pm.BlngAccountNum,
pp.demographicsexternalidnum as MemberID,
eb.pmtmethodgrpaccountholdername,
eb.pmtmethodgrpbankroutingnum,
eb.pmtmethodgrpbankaccountnum,
eb.pmtmethodgrpbankaccounttype
FROM prembill.ebillpmtmethod eb
LEFT JOIN security.users ss
ON eb.createdby = ss.usernum
LEFT JOIN member.personcntr pc
ON pc.personnum = eb.personnum
LEFT JOIN member.contracts cc
ON pc.cntrnum = cc.cntrnum
INNER JOIN prembill.blngaccounts ba
ON cc.cntrnum = ba.blngaccountnum
INNER JOIN member.person pp
ON eb.personnum = pp.personnum
LEFT JOIN PREMBILL.EbillPmt pm
ON eb.pmtmethodnum=pm.PmtMethod
WHERE eb.createddate = ‘2022-07-12’
AND eb.pmtmethodgrpstatus = ‘2’
AND eb.pmttype = ‘ACH’
AND eb.createdby NOT IN ( ‘20017’, ‘2’ )

Regards,
Divya.

Hi @divya.x.kuchi,

If this is a working query then all you need to do is to use the Execute Query activity. Paste it in there within double quotes.

enclose the column names in square brackets [ ]

Hi I tried in this way. it’s throwing me the error.

Try this:

“SELECT DISTINCT [eb].[pmtmethodnum],
[eb].[createdby],
[ss].[username],
[eb].[createddate],
[eb].[createdtime],
[eb].[pmtmethodgrpstatus],
[eb].[pmttype],
[pm].[BlngAccountNum],
[pp].[demographicsexternalidnum],
[eb].[pmtmethodgrpaccountholdername],
[eb].[pmtmethodgrpbankroutingnum],
[eb].[pmtmethodgrpbankaccountnum],
[eb].[pmtmethodgrpbankaccounttype]
FROM [prembill].[ebillpmtmethod] eb
LEFT JOIN [security].[users] [ss]
ON [eb].[createdby] = [ss].[usernum]
LEFT JOIN [member].[personcntr] pc
ON [pc].[personnum] = [eb].[personnum]
LEFT JOIN [member].[contracts] cc
ON [pc].[cntrnum] = [cc].[cntrnum]
INNER JOIN [prembill].[blngaccounts] ba
ON [cc].[cntrnum] = [ba].[blngaccountnum]
INNER JOIN [member].[person] pp
ON [eb].[personnum] = [pp].[personnum]
LEFT JOIN [PREMBILL].[EbillPmt] pm
ON [eb].[pmtmethodnum]=[pm].[PmtMethod]
WHERE [eb].[createddate] = ‘2022-07-12’
AND [eb].[pmtmethodgrpstatus] = ‘2’
AND [eb].[pmttype] = ‘ACH’
AND [eb].[createdby] NOT IN ( ‘20017’, ‘2’ )”