Toad World® Forums

Automation-connecting to the wrong server

I am having an issue with an automation that I have created. I am running this particular item 3 times per day currently while trying to track down the issue. This will become weekly once it is stabilized.

My issue, though, is about database connection/server connections. When I run the automation manually, everything runs fine. However, I get the error message:

“Export_2 - ERROR [42704] [IBM][DB2/AIX64] SQL0204N “M.WRK” is an undefined name.”

The issue here is that the WRK table is listed under a different schema, it should connect to the same server, but schema z. I have both schemas saved as separate connections with those as the default schemas, and have inserted connecion_1 with export A and connection 2 with export B so that the information regarding which connection/schema is there and should be pulled.

What am I doing wrong? How can I fix this issue? Why does it work manually but not as part of the automated tasks? Is it possible that toad looks at the connection, sees that its the same server and stays connected without regard for schema?

don’t know if Toad is using the same connection but you can get around that problem by fully qualifying your table names.

From Database.Schema.TableName

Then you only need one connection.

I will give that a try. When I started setting up these automations, I tried that and have to add connections because it didnt understand putting the schemas in that way. I will try it again though.