Oracle Database - Problem wirh insert into as SQL

Hi there,

I’m looking for some help with a problem that I haven’t been able to solve yet. We have an Oracle database where we want to insert some information. The database connection works fine, and we can use the “Run Query” activity to retrieve some data. However, when we try to use the “Run Command” activity to execute an “INSERT INTO” SQL query, we receive an error message: “Run command: ERROR [HY000] [Oracle][ODBC][Ora]ORA-00928: missing SELECT keyword”.

Why is the “SELECT” keyword missing? If I run the exact same SQL query directly on our database server, it works fine. Do you have any ideas on what might be wrong or how to solve this?

These are the versions we are using:
Studio: 2021.10.3
UiPath.Database.Activities: 1.7.1

This is our test process, and here are the SQL queries we are trying to run:
The SELECT SQL query:
“SELECT ‘Name’, ‘Number’ FROM TestDB.tblTest;”

The INSERT SQL query (with variations we have tried):
“INSERT INTO TestDB.tblTest (‘Name’, ‘Number’) VALUES (‘Test’, 1);”

“INSERT INTO TestDB.tblTest (Name, Number) VALUES (‘Test’, 1);”
→ Run command: ERROR [42S22] [Oracle][ODBC][Ora]ORA-00904: “NUMBER”: invalid identifier.

Hi @Xyp,

Welcome to UiPath Community

The issue with the INSERT SQL query is that the keyword “NUMBER” is a reserved word in Oracle database, and it’s not a valid identifier for a column name. Therefore, you should change the column name to something else, like “TestNumber”.

Here is the corrected INSERT SQL query:

“INSERT INTO TestDB.tblTest (Name, TestNumber) VALUES (‘Test’, 1);”

Thanks,

@RajKumar_DC
thx for the quick response.
you’re right “Number” is reserved. I’ve anonymized the prompts for the post.
With “Testnumber” it remains the same error.

And without this column, the Error changes the same:
“INSERT INTO TestDB.tblTest (Name) VALUES (‘Test’);”
→ […] “Name”: invalid identifier.

Hi @Xyp,

If changing the column name to something other than “Number” still results in an error, it could be that the column names in the Oracle database are case sensitive. In that case, try changing the column name in the SQL query to match the exact case of the column name in the database table.

already tried all upper case, all lower case. Exactly like in the DB.
As mentioned before. When i execute the SQL promt (with DBVisualizer) directly, it’s working.
I guess it might be a problem how the Activity fowards the promt.