jackxm(原作)
這段時(shí)間用了一下c++ builder ,在調(diào)用存儲過程的時(shí)候遇到了一些問題,問了很多地方都沒有找到答案,最后還是靠自己,現(xiàn)在拿出來和大家分享。
示例代碼:
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();
問題:調(diào)用存儲過程的時(shí)候總是報(bào)錯(cuò),注意,時(shí)在執(zhí)行storedproc1->execproc()的時(shí)候就會報(bào)錯(cuò),其它的地方報(bào)的錯(cuò)誤的解決方法不再本篇文章中。執(zhí)行代碼報(bào)錯(cuò)時(shí)的錯(cuò)誤信息提示:錯(cuò)誤:indicator variable required but not supplied
原因:當(dāng)在執(zhí)行的存儲過程的時(shí)候,如果有一項(xiàng)出項(xiàng)空值的時(shí)候,就會發(fā)生這樣的問題
解決:在存儲過程中對產(chǎn)成的空值進(jìn)行處理,就可以了
新聞熱點(diǎn)
疑難解答
圖片精選