Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-5396

Querying SQL Server variant type for a string fails

XMLWordPrintable

      Table on SQL Server source created as

      CREATE TABLE table_with_variant(id INT, var SQL_VARIANT)

      and loaded with int, float and string data.

      Running the following query against a dynamic VDB with metadata import

      SELECT cast(var AS string) FROM table_with_variant WHERE id = 1

      fails with

      java.sql.SQLException: Remote com.microsoft.sqlserver.jdbc.SQLServerException: The "variant" data type is not supported.

      This query used to work with DV 6.4.2, it appears it is a further regression from TEIID-5313 . Querying rows with non-string data works as expected.

      SOURCE SRC command with 6.4.2 (working):

      SELECT cast(g_0."var" AS varchar(4000)) FROM "dballo05"."dbo"."table_with_variant" g_0 WHERE g_0."id" = 1

      SOURCE SRC command with 6.4.3 (not working), note missing cast to varchar:

      SELECT g_0."var" FROM "dballo06"."dbo"."table_with_variant" g_0 WHERE g_0."id" = 1

              rhn-engineering-shawkins Steven Hawkins
              asmigala@redhat.com Andrej Smigala
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: