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();