1 { 2 odbc操作sqlite帮助类 3 author:yywang 4 date:2013-5-15 5 } 6 unit CommUtils; 7 8 interface 9 10 uses 11 SysUtils, Windows, ActiveX, DB, ADODB, Generics.Collections; 12 13 type 14 TParameterMap = class 15 16 private 17 thisKey: string; 18 thisValue: Variant; 19 thisDataType: TDataType; 20 thisSize: Integer; 21 public 22 constructor Create(key: string; value: Variant); overload; 23 constructor Create(key: string; value: Variant; dataType: TFieldType; 24 size: Integer); overload; 25 26 function GetKey: string; 27 function GetValue: Variant; 28 function GetDataType: TDataType; 29 function GetSize: Integer; 30 31 procedure SetKey(key: string); 32 procedure SetValue(value: Variant); 33 procedure SetDataType(dataType: TDataType); 34 procedure SetSize(size: Integer); 35 36 published 37 property key: string read GetKey write SetKey; 38 property value: Variant read GetValue write SetValue; 39 property dataType: TDataType read GetDataType write SetDataType; 40 property size: Integer read GetSize write SetSize; 41 42 end; 43 44 TSqlHelper = class 45 46 public 47 { 执行单个插入更新删除sql } 48 function ExecSQL(sql: string): Integer; overload; 49 50 { 执行单个插入更新删除sql 参数化 } 51 function ExceSQL(sql: string; parms: TList<TParameterMap>): Integer; 52 overload; 53 54 { 执行批量的sql插入更新删除 } 55 function ButchExecSQL(sqls: TList<string>): Integer; 56 57 { 获取单个值得查询 } 58 function GetSingle(sql: string): Variant; overload; 59 60
delphi 版 sqlHelper第二版
最新推荐文章于 2024-09-02 15:53:47 发布