Using parameters in <sql> tag

Hi everyone,

is it possible to use the parameters which normally can be accessed by ${param} within the sql-Tag? I use the parameters to specify tablespaces and the schema name and so it would be helpful to use it in my custom statements.

Kind regards
Oliver

It should work OK in the sql tag - however, they are not supported within sqlFile tags.

Ben

Also, the ${param} syntax is only supported within tag bodies (like ) in 2.0, not 1.9 and earlier.

Nathan

Originally posted by: drn
It should work OK in the sql tag - however, they are not supported within sqlFile tags.

Ben

Tip: I’m filtering sqlFile - style sources using maven facilities. See http://maven.apache.org/plugins/maven-resources-plugin/ for more information and example page how to switch it on/off http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html

Hi,
filtering the sql files and changesets is the way to go. We for example dynamically prepend the schema name for each database object name (create myschema.mytable…) by replacing a “${ds.schema}” token.

  1. Since liquibase is using the classpath while referencing sql files its simple to copy-filter and use the correct version.
  2. After the copy process the same structure exists in the target folder.
  3. Then you can use liquibase on exactly those copied changesets and sql files

In Ant its really simple:

            ... ... <target ...                                 ...

Regards,
Oliver