Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-9750

Syntax error on parameterized Query

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: Impala 2.6.4
    • Fix Version/s: None
    • Component/s: Clients
    • Labels:
      None
    • Epic Color:
      ghx-label-2

      Description

      Parameterized Query Returning Syntax error on Windows 2.6.4 driver

      //insert request
      string insertString = "" +
      " INSERT INTO request " +
      " (aa_requestid, requestid, messageid, dti, prime, payloadcategory, createddate) " +
      " VALUES " +
      " (?, ?, ?, ?, ?, ?, ?); ";
      string insertSubString = "";
      OdbcCommand command = new OdbcCommand(insertString);
      OdbcCommand subCommand = new OdbcCommand(insertSubString);
      using (OdbcConnection connection = new OdbcConnection(SBFraudConnectionStringImpala))
      {
      command.Parameters.AddWithValue("@aa_requestid", Guid.NewGuid().ToString());
      command.Parameters.AddWithValue("@requestid", processCreditDecisionRequest.RequestId);
      command.Parameters.AddWithValue("@messageid", processCreditDecisionRequest.MessageId);
      command.Parameters.AddWithValue("@dti", processCreditDecisionRequest.DTI);
      command.Parameters.AddWithValue("@prime", processCreditDecisionRequest.Prime);
      command.Parameters.AddWithValue("@payloadcategory", processCreditDecisionRequest.PayloadCategory);
      command.Parameters.AddWithValue("@createddate", DateTime.Now.Date.ToString("yyyy-MM-dd"));
      command.Connection = connection;
      connection.Open();

      command.ExecuteNonQuery();

       

      StackTrace="System.Data.Odbc.OdbcException (0x80131937): ERROR [42000] [Cloudera][ImpalaODBC] (360) Syntax error occurred during query execution: [HY000] : AnalysisException: Syntax error in line 1:
      ...y, createddate) VALUES (?, ?, ?, ?, ?);
      ^
      Encountered: Unexpected character
      Expected: CASE, CAST, DEFAULT, EXISTS, FALSE, IF, INTERVAL, NOT, NULL, REPLACE, TRUNCATE, TRUE, IDENTIFIER

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              maurices Kevin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: