欢迎光临
我们一直在努力

使用存储过程时一个错误的解决方法。-数据库专栏,SQL Server

建站超值云服务器,限时71元/月

这段时间用了一下c++ builder ,在调用存储过程的时候遇到了一些问题,问了很多地方都没有找到答案,最后还是靠自己,现在拿出来和大家分享。

示例代码:

   storedproc1->params->clear();
   storedproc1->params->createparam( ftsmallint, “@m1”,   ptinput);
   storedproc1->params->createparam( ftstring,  “@m2”, ptoutput);
   storedproc1->params->createparam( ftinteger,  “@m3”, ptoutput);
   storedproc1->params->createparam( ftinteger, “@m4”,   ptoutput);
   storedproc1->params->createparam( ftinteger,  “@m5”, ptoutput);
  
   storedproc1->params->createparam( ftinteger, “result”, ptresult);
   storedproc1->prepare();
   storedproc1->execproc();

问题:调用存储过程的时候总是报错,注意,时在执行storedproc1->execproc()的时候就会报错,其它的地方报的错误的解决方法不再本篇文章中。执行代码报错时的错误信息提示:错误:indicator variable required but not supplied

原因:当在执行的存储过程的时候,如果有一项出项空值的时候,就会发生这样的问题

解决:在存储过程中对产成的空值进行处理,就可以了

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 使用存储过程时一个错误的解决方法。-数据库专栏,SQL Server
分享到: 更多 (0)

相关推荐

  • 暂无文章