zoukankan      html  css  js  c++  java
  • JSON序列——根据JSON生成事务性SQL

    JSON序列——根据JSON生成事务性SQL

    procedure TForm1.Button5Click(Sender: TObject);
    begin
      var json: string :='' +
            '{'+
    			  '"table":"tunit",'+
                '"rows":'+
                '['+
                    '{"action": "modify", "original": {"unitid":"11","unitname":"个"}, "current": {"unitid":"11","unitname":"中"}},'+
                    '{"action": "delete", "original": {"unitid":"66","unitname":"国"}},'+
                    '{"action": "insert", "current":{"unitid":"13","unitname":"人"}}'+
                ']'+
            '}';
      var serial: TynJsonCross := TynJsonCross.Create;
      try
        Memo1.Text := serial.JsonToSql(json);
      finally
        serial.DisposeOf;
      end;
    end;
    

      生成的事务性SQL:

    update tunit set unitid='11',unitname='中' where unitid='11' and unitname='个'
    delete from tunit where unitid='66' and unitname='国'
    insert into tunit (unitid,unitname) values ('13','人' )
    

      

  • 相关阅读:
    测试
    pytest -- Windows fatal exception: code 1073807366
    cookie绕过验证码登录操作
    python接口自动化基本流程
    测试-pytest框架
    测试
    flask框架
    阿里巴巴集团面试
    字节跳动一面
    mysql 存储引擎
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/10657013.html
Copyright © 2011-2022 走看看