存取器不是参数存取器

 

ado的精度要小于oracle的精度,所以在sql语句查询时要限制精度的大小,否则在读取超出精度的数值是程序将报错

下面这段去掉trunc就报错

bool checkComTime(string interval,string currentIncValue)
{
 string sqlstr;
 string pcode,fcode,icode;
 pcode="1111";
 fcode="01";
 icode="download01";
 sqlstr="select trunc((sysdate-nvl((select lastcomtime  from tctpctrl where pointcode='"+pcode+"' and facecode='"+fcode+"' and itemcode='"+icode+"'),sysdate-365))*1440,2) diffmi,nvl((select currentincvalue  from tctpctrl where pointcode='"+pcode+"' and facecode='"+fcode+"' and itemcode='"+icode+"'),0) incvalue from dual";
 
 _RecordsetPtr rst;
 string strerr="";
 rst=dbo.ExecuteWithResSQL(sqlstr);
 if(strerr!="")
  cout<<strerr<<endl;
 string strdiff;
 if(rst==NULL)
  cout<<"空"<<endl;
 try
 {
 
 while(!rst->adoEOF)
 {
  strdiff=(LPSTR)(_bstr_t)(rst->GetCollect(_variant_t("diffmi")));
  currentIncValue=(LPSTR)(_bstr_t)(rst->GetCollect(_variant_t("incvalue")));
  cout<<strdiff<<endl;
  cout<<currentIncValue<<endl;

  rst->MoveNext();
 }
 }
 catch (_com_error &e)
 {
  wcout<<e.Description();
 }
 rst->Close();
 rst=NULL;

 int a,b;
 a=atoi(strdiff.c_str());
 b=atoi(interval.c_str());
 
 if(a>b)
 {
  return true;
 }
 else
 {
  return false;
 }
}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值