sprintf 的用法

zdy0155 2003-05-06 04:58:26
怎么用啊
sqlstr.sprintf("update dial_qfyh set flag=10,rq=getdate() where dhh='%s'",SendDhh);
不知道什么意识啊
int SendDhh
...全文
24 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
xuv2002 2003-05-06
  • 打赏
  • 举报
回复
sqlstr.sprintf("update dial_qfyh set flag=10,rq=getdate() where dhh='%s'",SendDhh);
你这句会出问题吧
%s 是用来代替字串的,改改
%d 才是用来替代整数的
sqlstr.sprintf("update dial_qfyh set flag=10,rq=getdate() where dhh='%s'",IntToStr(SendDhh));

假设SendDhh = 3;

执行后sqlstr 就是
update dial_qfyh set flag=10,rq=getdate() where dhh='3'



zdy0155 2003-05-06
  • 打赏
  • 举报
回复
具体有那些参数 最好举例说明啊
谢谢

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧