oracle的insert键值对操作:

//此代码是深圳雁联公司查询报文时给数据库字段赋值的代码,由于没有代码库函数不能通过定义去找,这里我就写个汉语意思吧
#include<globaldata.hpp>
using namespace aps;
#ifdef Z_USE_NAMESPACE_IN_ENTITY
using namespace;
#endif

using namespace aps;
using namespace aps::db;

//insert 语句

#define _GET_INSERT_SQL_YINK(sql,val,idx) do
{
    if(idx!=0)
    sql+=",";
    if(val.isNull())   //如果val为空的话,就在此处取默认值
    {
        if(val.getIsDefault())
            sql+="'" + val.getIsDefault()+"'";  //如果val为空的话,就在此处取默认值
        else
            sql+="NULL";   //如果没有默认值的话,就给sql赋空
    }
    else
    {
        sql+=getBindFlag(idx);   //绑定键值对
    }
while(0);
}

猜你喜欢

转载自blog.csdn.net/Makefilehoon/article/details/81294055