【问题标题】:ERROR: : Syntax error: Exception parsing query near '''错误::语法错误:'''附近的异常解析查询
【发布时间】:2015-05-25 06:50:01
【问题描述】:

Npgsql对denodo视图执行更新语句失败,因为语法错误

"ERROR:  : Syntax error: Exception parsing query near '''". When debug, I saw below translated sql statement which was pass to denodo from Npgsql parser.
"update testdenodoupdate set TestValue = ((E'aa')::text) where id = ((1)::int4);"

由于denodo 无法识别该语句,因此失败。

请帮助建议是否有其他替代解决方案? 我提供的测试代码如下:

NpgsqlConnection conn = new NpgsqlConnection("Server=xx.xx.xx.xx;Port=9996;Database=xxx;User Id=xx;Password=xx;CommandTimeout=40;");

    conn.Open();
    NpgsqlCommand command = new NpgsqlCommand("update testdenodoupdate set TestValue = :TestValue where id = :id;", conn);
    command.Parameters.Add(new NpgsqlParameter("TestValue",             NpgsqlTypes.NpgsqlDbType.Text));
    command.Parameters[0].Value = "aa";
    command.Parameters[0].SourceColumn = "TestValue";

    command.Parameters.Add(new NpgsqlParameter("id", NpgsqlTypes.NpgsqlDbType.Integer));
    command.Parameters[1].Value = 1;
    command.Parameters[1].SourceColumn = "id";

    ssUpdatedRows = command.ExecuteNonQuery();   

【问题讨论】:

  • 尝试删除;
  • 给出同样的错误,垫子。

标签: parsing npgsql denodo


【解决方案1】:

您可以试试最近发布的新 3.0.0-beta0001 版本吗?参数处理发生了显着变化,问题可能不再存在。

【讨论】:

    【解决方案2】:

    在以前的 Denodo 版本中,只需通过 Npgsql 数据提供程序进行选择操作。最新更新包括对整个 CRUD 操作的支持。

    【讨论】:

      猜你喜欢
      • 2019-10-13
      • 2017-07-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多