[wix-users] Iteration - Can it be done dynamically depending on a runtime variable

Venkatesan, Ravikumar Ravikumar.Venkatesan at scientificgames.com
Tue Mar 15 03:32:21 PDT 2016


Hi All,

                I use the below code to iterate the execution of an SQL script file on a list of DBs that’s declared using “<?define?>” statement. Everything is fine with the below. However, what I really want is to use a dynamic list that shall be known only during the runtime instead of hardcoding it like this. Is there a way to do this?!


    <?define DynamicDBList="FinalStaging;FinalStaging2;FinalStaging3"?>

    <?foreach DynamicDB in $(var.DynamicDBList)?>
      <sql:SqlDatabase Id='Dynamic_SQLDB.$(var.DynamicDB)' Database='$(var.DynamicDB)' User='SQLUser_local_ETL' Server='[DATABASE_SERVER]'/>
    <?endforeach?>

                                  <Fragment Id='ThisMustWork2'>
    <ComponentGroup Id='cmpg_ThisMustWork2' Directory='INSTALLFOLDER'>
      <Component Id='cmp_ThisMustWork2' Guid='CA2C7BB6-2D71-486D-9355-884CFA7ADF3D' KeyPath='yes'>
        <?foreach DynamicDB in $(var.DynamicDBList)?>
          <sql:SqlScript Id='ss.$(var.DynamicDB)' BinaryKey='bi_TestScript' ExecuteOnInstall='yes' SqlDb='Dynamic_SQLDB.$(var.DynamicDB)' Sequence='1'/>
        <?endforeach?>
      </Component>
    </ComponentGroup>
  </Fragment>


Regards,
Ravy


Ravikumar Venkatesan | Lead Analyst | Bally Technologies India Private Limited<http://www.ballytech.com>   | (M) +91 98 8436 0607

May be privileged. May be confidential. Please delete if not the addressee.
Venkatesan Venkatesan



More information about the wix-users mailing list