Schema/Database change


I’m new to EasyMorph and was looking for a solution to a problem I have.

We have our dev and prod environments on the same database, when developing, I set the schema within the connection properties to “dev”, when moving the project to prod, I changed the connection schema to “prod” but, the process complains saying the table dev.tablename is not available. Is there an easy way to globally change the schema/database the processes are pulling/pushing or do you have to go into each pull/push process and reselect the required table?

Hi Laurence and welcome to the Community!

Usually, the recommended way is to have two different databases for “dev” and “prod” environments with identical schema and table names. In this case, switching between them is easy as changing connector name.

In your case, qualified table names in dev and prod are different and therefore should be specified using calculated parameters. You can have a parameter {Schema} for the schema name with two values (e.g. “dev” and “prod”), and then for each table name have a parameter calculated as

{Schema} & '.' & 'Table_name'

Use such calculated parameters instead of explicitly specified table names in actions.

Note that as of version 5.0, the visual query in the “Import from database” action doesn’t allow specifying a table name using a parameter (it will become possible in v5.1). However, you can switch your query from the visual mode to the custom SQL mode and use there a parameter for the table name.

Thanks for that but how would that work when building an “update database table” process as you do not have a custom SQL option available?

Hi Laurence,

The “Update database table” action already supports specifying a table name using a parameter.

To add to Andrew’s answer, to use a parameter for table name click the black arrow next to the table name field (see below). Read more about parameters here: Workflow parameters | EasyMorph