<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Custom Connector ODBC - Conversion error from string to varchar in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Connector-ODBC-Conversion-error-from-string-to-varchar/m-p/931595#M22301</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a custom connector written for ODBC to enable direct query in Power BI. When I am testing it out I am running it into below error -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SimpleDocumentEvaluator/GetResult/Evaluate {"Start":"2020-02-06T16:25:54.9123041Z","Action":"SimpleDocumentEvaluator/GetResult/Evaluate","HostProcessId":"25832","ProductVersion":"2.76.5678.782 (19.12)","ActivityId":"81cf1593-40cd-45af-9327-2d08dd8a8689","Process":"Microsoft.Mashup.Container.NetFX45","Pid":22924,"Tid":1,"Duration":"00:00:00.1040025"}&lt;BR /&gt;OdbcQuery/FoldingWarning {"Start":"2020-02-06T16:25:55.0300042Z","Action":"OdbcQuery/FoldingWarning","HostProcessId":"25832","Function Name":"AdjustForCompatibility","ProductVersion":"2.76.5678.782 (19.12)","ActivityId":"81cf1593-40cd-45af-9327-2d08dd8a8689","Process":"Microsoft.Mashup.Container.NetFX45","Pid":22924,"Tid":1,"Duration":"00:00:00.0000173"}&lt;BR /&gt;OdbcQuery/FoldingWarning {"Start":"2020-02-&lt;FONT color="#FF6600"&gt;06T16:25:55.0303225Z","Action":"OdbcQuery/FoldingWarning","HostProcessId":"25832","ErrorMessage":"Failed to convert type string to varchar, expression `OTBL`.`sgmtl_rptg_cd` to `ITBL`.`sgm_cd`.","ProductVersion":"2.76.5678.782 (19.12)","ActivityId":"81cf1593-40cd-45af-9327-&lt;/FONT&gt;2d08dd8a8689","Process":"Microsoft.Mashup.Container.NetFX45","Pid":22924,"Tid":1,"Duration":"00:00:00.0015620"}&lt;BR /&gt;OdbcQuery/FoldingWarning {"Start":"2020-02-06T16:25:55.0319004Z","Action":"OdbcQuery/FoldingWarning","HostProcessId":"25832","Function Name":"AdjustTextValuesForCompatibility","ProductVersion":"2.76.5678.782 (19.12)","ActivityId":"81cf1593-40cd-45af-9327-2d08dd8a8689","Process":"Microsoft.Mashup.Container.NetFX45","Pid":22924,"Tid":1,"Duration":"00:00:00.0000102"}&lt;BR /&gt;OdbcQuery/FoldingWarning {"Start":"2020-02-06T16:25:55.0319192Z","Action":"OdbcQuery/FoldingWarning","HostProcessId":"25832","Function Name":"ConvertForSize","ProductVersion":"2.76.5678.782 (19.12)","ActivityId":"81cf1593-40cd-45af-9327-2d08dd8a8689","Process":"Microsoft.Mashup.Container.NetFX45","Pid":22924,"Tid":1,"Duration":"00:00:00.0000053"}&lt;BR /&gt;OdbcQuery/FoldingWarning {"Start":"2020-02-06T16:25:55.0319321Z","Action":"OdbcQuery/FoldingWarning","HostProcessId":"25832","Function Name":"Convert","ProductVersion":"2.76.5678.782 (19.12)","ActivityId":"81cf1593-40cd-45af-9327-2d08dd8a8689","Process":"Microsoft.Mashup.Container.NetFX45","Pid":22924,"Tid":1,"Duration":"00:00:00.0000045"}&lt;BR /&gt;OdbcQuery/FoldingWarning {"Start":"2020-02-&lt;FONT color="#FF6600"&gt;06T16:25:55.0322693Z","Action":"OdbcQuery/FoldingWarning","HostProcessId":"25832","ErrorMessage":"Failed to convert from string to string for expression `OTBL`.`sgmtl_rptg_cd`. You can override this by using SqlGetInfo for converting from WVARCHAR to WLONGVARCHAR.","ProductVersion":"2.76.5678.782 (19.12)","ActivityId":"81cf1593-40cd-45af-9327-&lt;/FONT&gt;2d08dd8a8689","Process":"Microsoft.Mashup.Container.NetFX45","Pid":22924,"Tid":1,"Duration":"00:00:00.0004697"}&lt;BR /&gt;OdbcQueryDomain/ReportFoldingFailure {"Start":"2020-02-06T16:25:55.0333843Z","Action":"OdbcQueryDomain/ReportFoldingFailure","HostProcessId":"25832","Exception":"Exception:\r\nExceptionType: Microsoft.Mashup.Engine1.Runtime.FoldingFailureException, Microsoft.MashupEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\r\nMessage: Folding failed. Please take a look the information in the trace.\r\nStackTrace:\n at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQueryExpressionVisitor.Convert(OdbcTypeInfo typeInfo, OdbcScalarExpression expression)\r\n at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQueryExpressionVisitor.ConvertForSize(OdbcScalarExpression left, OdbcScalarExpression right, Int32 size, Boolean fallbackToLargestType)\r\n at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQueryExpressionVisitor.AdjustTextValuesForCompatibility(OdbcScalarExpression left, OdbcScalarExpression right)\r\n at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQueryExpressionVisitor.AdjustForCompatibility(OdbcScalarExpression left, OdbcScalarExpression right, Precision precision)\r\n at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQueryExpressionVisitor.VisitEquals(OdbcSqlExpression leftExpression, OdbcSqlExpression rightExpression, Precision precision, Boolean nullable)\r\n at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQueryDomain.OdbcOptimizingQueryVisitor.VisitJoinCore(JoinQuery joinQuery)\r\n at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQueryDomain.OdbcOptimizingQueryVisitor.VisitJoin(JoinQuery joinQuery)\r\n\r\n\r\n","ProductVersion":"2.76.5678.782 (19.12)","ActivityId":"81cf1593-40cd-45af-9327-2d08dd8a8689","Process":"Microsoft.Mashup.Container.NetFX45","Pid":22924,"Tid":1,"Duration":"00:00:00.0082509"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to overwrite SQL_CONVERT_WVARCHAR and SQL_CONVERT_WLONGVARCHAR, but I'm still seeing this error. Below is my SQLGetInfo.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;           SQLGetInfo = [
                // SQLGetinfo Overrides: https://docs.microsoft.com/en-us/power-query/odbc#overriding-sqlgetinfo
                SQL_AGGREGATE_FUNCTIONS = 0x0000007F,
                SQL_CONVERT_BIGINT = 0x000273D8,
                SQL_CONVERT_BIT = 0x000273D8,          
                SQL_CONVERT_FUNCTIONS = 0x00000003,
                SQL_CONVERT_INTEGER = 0x000273D8,
                SQL_CONVERT_LONGVARCHAR = 0x000273D8,
                SQL_CONVERT_REAL = 0x000273D8,
                SQL_CONVERT_SMALLINT = 0x000273D8,
                SQL_CONVERT_TIMESTAMP = 0x00023318,
                SQL_CONVERT_TINYINT = 0x000273D8,
                SQL_CONVERT_VARCHAR = 0x000273D8,
                SQL_CONVERT_WLONGVARCHAR = 0x000C273D8,
                SQL_CONVERT_WVARCHAR = 0x000C273D8,
                SQL_IDENTIFIER_QUOTE_CHAR = "`",
                SQL_GROUP_BY = 2,
                SQL_NUMERIC_FUNCTIONS = 0x007FFFEF,
                SQL_SCROLL_OPTIONS = 0x00000011,
                SQL_SQL_CONFORMANCE = 8,
                SQL_SQL92_DATETIME_FUNCTIONS = 0x00000007,
                SQL_SQL92_PREDICATES = 0x00001E07,
                SQL_SQL92_RELATIONAL_JOIN_OPERATORS = 0x00000158,
                SQL_SQL92_STRING_FUNCTIONS = 0x00000009,
                SQL_SQL92_VALUE_EXPRESSIONS = 0x00000007,
                SQL_STRING_FUNCTIONS = 0x00053FFF,
                SQL_SYSTEM_FUNCTIONS = 0x00000006,
                SQL_TIMEDATE_FUNCTIONS = 0x001E7FE7
            ],&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can any one help me out figuring this error and how to resolve it? Thanks for the help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Feb 2020 10:37:01 GMT</pubDate>
    <dc:creator>sbobba</dc:creator>
    <dc:date>2020-02-13T10:37:01Z</dc:date>
    <item>
      <title>Custom Connector ODBC - Conversion error from string to varchar</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Connector-ODBC-Conversion-error-from-string-to-varchar/m-p/931595#M22301</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a custom connector written for ODBC to enable direct query in Power BI. When I am testing it out I am running it into below error -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SimpleDocumentEvaluator/GetResult/Evaluate {"Start":"2020-02-06T16:25:54.9123041Z","Action":"SimpleDocumentEvaluator/GetResult/Evaluate","HostProcessId":"25832","ProductVersion":"2.76.5678.782 (19.12)","ActivityId":"81cf1593-40cd-45af-9327-2d08dd8a8689","Process":"Microsoft.Mashup.Container.NetFX45","Pid":22924,"Tid":1,"Duration":"00:00:00.1040025"}&lt;BR /&gt;OdbcQuery/FoldingWarning {"Start":"2020-02-06T16:25:55.0300042Z","Action":"OdbcQuery/FoldingWarning","HostProcessId":"25832","Function Name":"AdjustForCompatibility","ProductVersion":"2.76.5678.782 (19.12)","ActivityId":"81cf1593-40cd-45af-9327-2d08dd8a8689","Process":"Microsoft.Mashup.Container.NetFX45","Pid":22924,"Tid":1,"Duration":"00:00:00.0000173"}&lt;BR /&gt;OdbcQuery/FoldingWarning {"Start":"2020-02-&lt;FONT color="#FF6600"&gt;06T16:25:55.0303225Z","Action":"OdbcQuery/FoldingWarning","HostProcessId":"25832","ErrorMessage":"Failed to convert type string to varchar, expression `OTBL`.`sgmtl_rptg_cd` to `ITBL`.`sgm_cd`.","ProductVersion":"2.76.5678.782 (19.12)","ActivityId":"81cf1593-40cd-45af-9327-&lt;/FONT&gt;2d08dd8a8689","Process":"Microsoft.Mashup.Container.NetFX45","Pid":22924,"Tid":1,"Duration":"00:00:00.0015620"}&lt;BR /&gt;OdbcQuery/FoldingWarning {"Start":"2020-02-06T16:25:55.0319004Z","Action":"OdbcQuery/FoldingWarning","HostProcessId":"25832","Function Name":"AdjustTextValuesForCompatibility","ProductVersion":"2.76.5678.782 (19.12)","ActivityId":"81cf1593-40cd-45af-9327-2d08dd8a8689","Process":"Microsoft.Mashup.Container.NetFX45","Pid":22924,"Tid":1,"Duration":"00:00:00.0000102"}&lt;BR /&gt;OdbcQuery/FoldingWarning {"Start":"2020-02-06T16:25:55.0319192Z","Action":"OdbcQuery/FoldingWarning","HostProcessId":"25832","Function Name":"ConvertForSize","ProductVersion":"2.76.5678.782 (19.12)","ActivityId":"81cf1593-40cd-45af-9327-2d08dd8a8689","Process":"Microsoft.Mashup.Container.NetFX45","Pid":22924,"Tid":1,"Duration":"00:00:00.0000053"}&lt;BR /&gt;OdbcQuery/FoldingWarning {"Start":"2020-02-06T16:25:55.0319321Z","Action":"OdbcQuery/FoldingWarning","HostProcessId":"25832","Function Name":"Convert","ProductVersion":"2.76.5678.782 (19.12)","ActivityId":"81cf1593-40cd-45af-9327-2d08dd8a8689","Process":"Microsoft.Mashup.Container.NetFX45","Pid":22924,"Tid":1,"Duration":"00:00:00.0000045"}&lt;BR /&gt;OdbcQuery/FoldingWarning {"Start":"2020-02-&lt;FONT color="#FF6600"&gt;06T16:25:55.0322693Z","Action":"OdbcQuery/FoldingWarning","HostProcessId":"25832","ErrorMessage":"Failed to convert from string to string for expression `OTBL`.`sgmtl_rptg_cd`. You can override this by using SqlGetInfo for converting from WVARCHAR to WLONGVARCHAR.","ProductVersion":"2.76.5678.782 (19.12)","ActivityId":"81cf1593-40cd-45af-9327-&lt;/FONT&gt;2d08dd8a8689","Process":"Microsoft.Mashup.Container.NetFX45","Pid":22924,"Tid":1,"Duration":"00:00:00.0004697"}&lt;BR /&gt;OdbcQueryDomain/ReportFoldingFailure {"Start":"2020-02-06T16:25:55.0333843Z","Action":"OdbcQueryDomain/ReportFoldingFailure","HostProcessId":"25832","Exception":"Exception:\r\nExceptionType: Microsoft.Mashup.Engine1.Runtime.FoldingFailureException, Microsoft.MashupEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\r\nMessage: Folding failed. Please take a look the information in the trace.\r\nStackTrace:\n at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQueryExpressionVisitor.Convert(OdbcTypeInfo typeInfo, OdbcScalarExpression expression)\r\n at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQueryExpressionVisitor.ConvertForSize(OdbcScalarExpression left, OdbcScalarExpression right, Int32 size, Boolean fallbackToLargestType)\r\n at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQueryExpressionVisitor.AdjustTextValuesForCompatibility(OdbcScalarExpression left, OdbcScalarExpression right)\r\n at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQueryExpressionVisitor.AdjustForCompatibility(OdbcScalarExpression left, OdbcScalarExpression right, Precision precision)\r\n at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQueryExpressionVisitor.VisitEquals(OdbcSqlExpression leftExpression, OdbcSqlExpression rightExpression, Precision precision, Boolean nullable)\r\n at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQueryDomain.OdbcOptimizingQueryVisitor.VisitJoinCore(JoinQuery joinQuery)\r\n at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQueryDomain.OdbcOptimizingQueryVisitor.VisitJoin(JoinQuery joinQuery)\r\n\r\n\r\n","ProductVersion":"2.76.5678.782 (19.12)","ActivityId":"81cf1593-40cd-45af-9327-2d08dd8a8689","Process":"Microsoft.Mashup.Container.NetFX45","Pid":22924,"Tid":1,"Duration":"00:00:00.0082509"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to overwrite SQL_CONVERT_WVARCHAR and SQL_CONVERT_WLONGVARCHAR, but I'm still seeing this error. Below is my SQLGetInfo.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;           SQLGetInfo = [
                // SQLGetinfo Overrides: https://docs.microsoft.com/en-us/power-query/odbc#overriding-sqlgetinfo
                SQL_AGGREGATE_FUNCTIONS = 0x0000007F,
                SQL_CONVERT_BIGINT = 0x000273D8,
                SQL_CONVERT_BIT = 0x000273D8,          
                SQL_CONVERT_FUNCTIONS = 0x00000003,
                SQL_CONVERT_INTEGER = 0x000273D8,
                SQL_CONVERT_LONGVARCHAR = 0x000273D8,
                SQL_CONVERT_REAL = 0x000273D8,
                SQL_CONVERT_SMALLINT = 0x000273D8,
                SQL_CONVERT_TIMESTAMP = 0x00023318,
                SQL_CONVERT_TINYINT = 0x000273D8,
                SQL_CONVERT_VARCHAR = 0x000273D8,
                SQL_CONVERT_WLONGVARCHAR = 0x000C273D8,
                SQL_CONVERT_WVARCHAR = 0x000C273D8,
                SQL_IDENTIFIER_QUOTE_CHAR = "`",
                SQL_GROUP_BY = 2,
                SQL_NUMERIC_FUNCTIONS = 0x007FFFEF,
                SQL_SCROLL_OPTIONS = 0x00000011,
                SQL_SQL_CONFORMANCE = 8,
                SQL_SQL92_DATETIME_FUNCTIONS = 0x00000007,
                SQL_SQL92_PREDICATES = 0x00001E07,
                SQL_SQL92_RELATIONAL_JOIN_OPERATORS = 0x00000158,
                SQL_SQL92_STRING_FUNCTIONS = 0x00000009,
                SQL_SQL92_VALUE_EXPRESSIONS = 0x00000007,
                SQL_STRING_FUNCTIONS = 0x00053FFF,
                SQL_SYSTEM_FUNCTIONS = 0x00000006,
                SQL_TIMEDATE_FUNCTIONS = 0x001E7FE7
            ],&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can any one help me out figuring this error and how to resolve it? Thanks for the help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 10:37:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Connector-ODBC-Conversion-error-from-string-to-varchar/m-p/931595#M22301</guid>
      <dc:creator>sbobba</dc:creator>
      <dc:date>2020-02-13T10:37:01Z</dc:date>
    </item>
  </channel>
</rss>

