Oracle, Execute Query: All queries are throwing ORA-01036 (Illegal variable name/number)

Hi there!

I’m trying to return values from an Oracle database using a SELECT query.

I open a connection, like so:

  • Activity: UiPath.Database.Activities.DatabaseConnect
  • Connection String: “Data Source=(DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=.))(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=25888)));Uid=;Pwd=;”
  • ProviderName: “System.Data.OracleClient”

I then use that connection (conn) to execute a query. I have tried to pass the query in as a string variable. I then entered it directly into Query text with a parameter (referenced both by “@” and “:”); both variants failed with the ORA-01036 message. I then removed the parameter, and hardcoded the value; it executed.

While it’s nice to see it execute, this scenario doesn’t give me a lot of flexibility.
Has anyone been able to get a QueryStringVariable (sqlTextString) or a parameterized QueryString (with either a @ or “:” to denote the parameter) to return a data set?

Best regards,

Jeff

Can you give an example of your query?

I’ve been able to get some relatively simple parameterized queries to run using : to denote parameters. It is quite frustrating to get it right though, as it is impossible to debug what is causing it to fail when you’re building it out.

I’ve noticed that when inputting a string, you don’t need to add the single quotes ' around your parameter like you do when hard-coding it. Same thing with datetimes - no need to put in the number sign # around your parameter.