Welcome Guest! Log in
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…


It can be usefull to determin a table name at execution time, using a Metadata Variable. This article shows an example of how to do this.

The Metadata Variable

We created a new metadata variable, named "VAR_TABLE_NAME".

01-variable

 

The Table

For this example we use a very simple table. Note the presence of the Metadata link in the metadata structure, it refers to the Metadata Variable.

To do this, you need to drag and drop the Variable on the table.

Also, note the Physical Name of the table : %{VAR_TABLE_NAME}%.

02-table

The Process

Our process initializes the VAR_TABLE_NAME Variable, and executes a Sql Operation on the table.

03-process

 

Step 1: this action was created by drag'n'droping the variable on the process. Then, we set

  • VAR_OPERATION=SetValue
  • VAR_VALUE=table1

Step 2: we dragged the table on this SqlOperation so that the connection is automatically set.

View [3]: The SQL expression is:

insert into %x{$tableWithVarName/tech:physicalPath()}x%
values (99)

 

Execution

Here is the Sql expression that is executed :

insert into test.table1
values (99)

 

 

 

 

 

Articles

Suggest a new Article!