Welcome Guest! Log in
Due to some maintenance operations, stambia.org will be switched to read-only mode during the 13th November. It will be possible to read and download, but impossible to post on the forums or create new accounts. For any question please contact the support team.


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)

 

 

 

 

 

You have no rights to post comments

Articles

Suggest a new Article!