SQL querie with string var does not work

Hey guys,

I read 2 hours of “passing data in SQL query” but no solution work for me, so I just post my solution and hope you guys can help me with it :slightly_smiling_face:

I would like to access my database and get the content of my Column “Mail”.
It iss for checking if a user is verified to start a robot.

  1. I created a “read mail” activity and get the sender email. This works fine.
    I assigned that value to strInternalEmail (because it was a generic value first and its now a string) and now i would like to use the strInternalEmail value to search in my db.

  2. i created read db activity in UiPath to find the correct values… My DB is User with column UserID and Mail… Pretty simple…

“Select UserID From User Where Mail = '” + strInternalEmail+ “’”

I receive the error message :" read Mail from User : Syntaxerror in FROM-Klausel"…

What did i do wrong? I cant find a solution… - _-
Thanks for your help!

1 Like

okay, found a solution…
I dont know why, but UiPath did not like my “User” name…
I changed the table to Userbase and wrote “Select UserID FROM Userbase” and it works… now i can check my user by .contains…

1 Like

Hello @HeyThereImNew,

Try to pass the data in the parameter and execute it.

Thanks & Regards,
Urvesh Mistry

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