SQL Developer to Run Query SQL help

Hi all. New to using the database activities in UIPath.

Managed to connect to DB and run simple sql scripts and export as csv as I need.

Trying to plug in my sqldeveloper scripts and haven’t worked out the syntax,
keep getting SQL command not properly ended.

Is there some documentation anywhere that guides users on how to adapt their sql into UIPath sql ?

Iave encased the sql query in “” via the advanced editor, I have added it to a cell in the scratchpad and I have added it to a text file to try read it in that way. There must be something I’m missing with quotes or maybe a user could spot where I am going wrong.

select  d.LOCAL_START_DATE, d.PRI_IDENTITY, d.OWNER_CUST_CODE, f.Offering_code, 
case when e.SUBSCRIBER_IND is NULL then 'TRUE' else 'FALSE' end CVD_Stack,
when f.Offering_code = e.OFFER_ID and d.elapse_cycles >3 then 'DELETE'
when f.Offering_code ! = e.OFFER_ID and d.elapse_cycles < 3 then 'INVESTIGATE'
when d.stock_code like '98%' then 'IGNORE - TEST'
when e.offer_ID is null then 'STOCK_DELETED'
else 'INVESTIGATE' end 
left join REF.T_Stock_Detail e on (d.MCode = e.MCode
and e.effective_end_DTM > sysdate
and e.SUB_STATUS in ('A', 'B'))
left join RAC_MPC f on (d.Main_offering_ID = f.offering_ID)
where d.event_start_DTM >= to_date('01-Jul-2022','dd-mon-yyyy')
and d.stream_ID in ( 'MON','OMON' )
and d.debit_amount = 0
and d.MAIN_OFFER_ID  not in (17280,1380,42529,1397,17294,42530,17291)
and d.OFFERING_ID in (1040977,1040832,1040833,1040834);

Hi @Futan

Could You able to paste the thing in Run Query activity enclosed with doubleQuotes(") In an Expression Editor without any validation error.?

Like Below ScreenShot.


Hi Pravin

That was the first thing I tired and that’s what started the whole investigation.

Simply adding quotes around the query in the advanced editor gives the same error “SQL command not properly ended” which is why I tried to have it in a text file and a scratchpad cell and I still get the same error.

Scripts work perfectly in sqldeveloper.

This can be closed.

the ; at the end of the script was causing the problem.

1 Like

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