3 Replies Latest reply on Dec 9, 2014 9:28 PM by Steven Hawkins

    Using User-Defined Variables in Teiid-SQL Engine

    Morgan Kisienya Newbie

      Teiid returns errors when the following queries are executed on VDB

       

      SELECT @latsBatchID := MAX(BatchID) FROM ltcbatch;

       

      Error

      Remote org.teiid.api.exception.query.QueryParserException: TEIID31100 Parsing error: Encountered "SELECT @latsBatchID [*]:[*]= MAX" at line 1, column 21.

      Was expecting: <EOF> | "and" | "as" | "between" | "except" | "fetch" | "from" | "in" | "intersect" | "into" ...

       

      set @firstname = 'xxxxx;

       

      Error

      Remote org.teiid.api.exception.query.QueryParserException: TEIID31100 Parsing error: Encountered "[*]set[*] @firstname =" at line 1, column 1.

      Was expecting: "alter" | "begin" | "call" | "create" | "delete" | "drop" | "exec" | "execute" | "insert" | "merge" ...

       

      How do i get to run such queries, in essence how can i pass a value to a variable or use user-defined variables in Teiid-SQL Engine?