string tblins = "";tblins = "INSERT INTO " + commtable + " " "(vdoc,bdoc,mytime,txml) VALUES (" "'" + cxml.vdoc + "'," + cxml.bdoc + "," //integer "'" + cxml.mytime + "'," "'" + cxml.txml + "')";result = PQexec(conn,tblins.c_str());
谢谢.
解决方法 是的,您可以使用PQexecParams函数,如 in the documentation所述.总结If parameters are used,they are referred to in the command string as
,
,etc.
nParams
is the number of parameters supplIEd; it is the length of the arraysparamTypes[]
,paramValues[]
,paramLengths[]
,andparamFormats[]
.
以上是内存溢出为你收集整理的postgresql – libpq,带参数插入全部内容,希望文章能够帮你解决postgresql – libpq,带参数插入所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)