I am unable to execute the SQL query

“Select Distinct AD.TO_LOC
FROM ALLOC_HEADER AH, ALLOC_DETAIL AD
WHERE AH.ALLOC_NO = AD.ALLOC_NO
And AH.ORDER_NO = @PO

I am trying to execute the above query as @PO is the Argument with contains the String value.
It gives the error as
image
Run query: ERROR [HY000] [Oracle][ODBC][Ora]ORA-00936: missing expression

Try to build the query before the Run query activity and save it in a separate file.

Then, read the file content as a string. In the end, in the Run query activity, use the stored string value as the query.

Let us know if this helped you.

Hi @rv.jain9277,

Let SQL do the hardwork for you. Why not use Stored Procedure? That way you dont have to bother about string syntax’s. You call a Stored Procedure and it returns your query for you.

You still use the same Execute Query, but using a Stored Procedure will make the code easier to read and set a clear separation between UiPath and SQL related logic in your code.

Here is how you use Stored Procedure and parameters