Niklas,
Years and years ago, I ran into the same exact issue you described. Back then, the solution that I settled on was to use the Dynamic SQL template to create my adapter services with SQL statements that looked sort of like this:
SELECT * FROM ${schema}.
…
The actual schema was stored in a properties file and I would simply pass it in as an argument when calling the adapter services.
This is one way to accomplish your goal, but I must admit, it’s not great. I tend to avoid Dynamic SQL if possible.
So what other alternatives are there?
First, let me confirm this: even though the schema name changes from environment to environment, I’m assuming that each environment has its own separate database server in which each respective schema resides, correct? In other words, we’re not talking about a single database server that hosts all three schemas, are we?
Assuming separate database servers, then one option is to do what Holger has suggested and simply don’t specify a schema in your adapter services. Instead, use . Now, I imagine that that your challenge is that the default schema for the account you’re connecting with is the not the same schema that has the tables you want to query, is that true?
In that case, then my suggestion is to ask the DBA to create a logon trigger for that account that changes the default schema for that user. This is simply done via the SQL:
ALTER SESSION SET CURRENT_SCHEMA =
If your DBA does not want to do this, then yet another alternative is to use synonyms. Synonyms are sort of like symbolic links. So, in other words, you could create synonyms in your default schema that point to the actual tables. Then, instead of pointing the adapter services to the actual tables, you can point them to the synonyms, makes sense?
If none of these options are viable, let us know and we’ll take another stab at it.
Percio
#webMethods-General#webMethods#Integration-Server-and-ESB