Skip to main content

Troubleshooting robot error: "Error from the Store in Database action. Unable to store value in database. Invalid object name"



When using a step that interacts with a database, the robot can use a database mapping which will specify the actual database to which to connect. For more information about creating the database mappings themselves, please refer to the "Interacting with Database" section in the Documentation.

Some of the steps that interact with databases will automatically build the queries based on the selected options (Store in Database, Find in Database, Delete from Database) and others can take a custom query as input (Query Database, Execute SQL).

When a custom query is entered, it should NEVER contain the "USE" statement.The steps in the robot have a separate setting where the database mapping can be selected - this is the database on which the query will be executed.

If a custom query starts with a "use <AnotherDatabase>", the database mapping selected previously will be changed to point to <AnotherDatabase> during the current robot's execution and any other robot running afterwards.


You have 3 robots: Robot1, Robot2 and Robot3, each of them storing data in the same database, KapowDataDB. There is a mapping called KapowDataMapping that points to KapowDataDB.

You create another robot, called ChangeMapping that contains a Query Database step with the following query:

     use AnotherDB
     select db_name() as Name

And the 'Name' column is returned.

Assume Robot1 is running and storing data in the table as expected. If the ChangeMapping robot is started, it will change the mapping from

KapowDataMapping -- maps to --> KapowDataDB


KapowDataMapping -- maps to --> AnotherDB

This will change the mapping for any robot running afterwards. So Robot1 will be pointed to AnotherDB and if Robot2 and Robot3 are started, they will be pointed to AnotherDB as well.

As expected, the Store in Database steps will fail (since the robots won't find the tables they need on AnotherDB) and the following error will be seen in the Robot

"Error from the Store in Database action. Unable to store value in database. Invalid object name"

The database mapping can be changed again to point to the correct database (KapowDataDB) by running a robot containing an Execute SQL step that will execute this query:

     use KapowDataDB

At this point the mapping will be changed back to

KapowDataMapping -- maps to --> KapowDataDB

so the robots will be able to store data again.

Keywords: Kapow robot, store in database, Kapow, Robotic Process Automation