delphi 版 sqlHelper第二版

本文将详细介绍 Delphi 开发中使用的 SQLHelper 工具库的第二版,包括其新特性、如何使用以及在实际项目中的应用案例,帮助开发者更高效地进行数据库操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  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     
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值