ExternalDataAccess BypassPrepare = true

Jul 17, 2015 at 5:28 PM
Dear,

when using this script, i have an error when it prepares the query.
When using a sql query with the same provider, we set-up the BypassPrepare to true. Can we do the same for the ExternalDataAccess object?

<#@ template language="C#" hostspecific="true" #>
<#@ import namespace="System.Data" #>
<#@ import namespace="System.Data.SqlClient" #>
<#@ import namespace="System.IO" #>
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<!-- <# string connectionStringSource = @"Server=toto;Initial Catalog=SYS;Provider=AttunityConnect;Database=SYS;Binding=NAVIGATOR;"; string connectionStringDestination = @"Server=srvvovo;Initial Catalog=vovo;Integrated Security=SSPI;Provider=SQLNCLI11.1"; string SrcTableQuery = @"SELECT ""RDB$RELATION_NAME"" FROM SYS:""public"".""Rdb$RELATIONS"" WHERE (""RDB$RELATION_NAME"" NOT LIKE 'RDB%')"; DataTable dt = null; dt = ExternalDataAccess.GetDataTable(connectionStringSource, SrcTableQuery); #> -->
<Connections>
    <OleDbConnection
        Name="SRC"
        CreateInProject="false"
        ConnectionString="<#=connectionStringSource#>"
        RetainSameConnection="false">
    </OleDbConnection>
    <OleDbConnection
        Name="DST"
        CreateInProject="false"
        ConnectionString="<#=connectionStringDestination#>"
        RetainSameConnection="false">
    </OleDbConnection>
</Connections>

<Packages>
    <# foreach (DataRow dr in dt.Rows) { #>
        <Package ConstraintMode="Linear" Name="<#=dr[1].ToString()#>" >
        <Variables>
            <Variable Name="SchemaName" DataType="String"><#=dr[0].ToString()#></Variable>
            <Variable Name="TableName" DataType="String"><#=dr[1].ToString()#></Variable>
            <Variable Name="QualifiedTableSchema"
                      DataType="String"
                      EvaluateAsExpression="true">"[" +  @[User::SchemaName] + "].[" +  @[User::TableName] + "]"</Variable>
        </Variables>
        <Tasks>
            <Dataflow Name="DFT" >
                <Transformations>
                    <OleDbSource
                        Name="OLE_SRC <#=dr[0].ToString()#>_<#=dr[1].ToString()#>"
                        ConnectionName="SRC"
                    >
                        <TableFromVariableInput VariableName="User.QualifiedTableSchema"/>
                    </OleDbSource>
                    <OleDbDestination
                        Name="OLE_DST <#=dr[0].ToString()#>_<#=dr[1].ToString()#>"
                        ConnectionName="DST"
                        KeepIdentity="true"
                        TableLock="true"
                        UseFastLoadIfAvailable="true"
                        KeepNulls="true"
                        >
                        <TableFromVariableOutput VariableName="User.QualifiedTableSchema" />                        
                    </OleDbDestination>
                </Transformations>
            </Dataflow>

        </Tasks>
        </Package>
    <# } #>
</Packages>
</Biml>