标签:int between dat文件 sprint nsa 变量类型 one exe char*
使用方法:
int resultValue;
char* userId="1000";
char insertQuery[22584];
//init mysql conection
MySqlInit();
//sprintf(insertQuery, "INSERT INTO `webcat_cloud`.`t_wechat_user` (`user_id`,`open_id`, `subscribe_flag`,`create_date`,`l_upd_date`) VALUES (‘367‘,‘adadfasdfs‘, ‘0‘,now(),now())");
//拼接sql语句
strcpy(insertQuery, "INSERT INTO `webcat_cloud`.`t_wechat_user` (`user_id`,`open_id`, `subscribe_flag`,`create_date`,`l_upd_date`) VALUES ( ‘");
strcat(insertQuery, lr_eval_string(userId)); //参数化数据
strcat(insertQuery, "‘, ‘");
strcat(insertQuery, lr_eval_string(openId)); //参数化数据
strcat(insertQuery, "‘,‘0‘,now(),now())");
strcat(insertQuery, ";");
lr_message(insertQuery);
//execute sql
lr_start_transaction("Insert");
resultValue=InsertValue(insertQuery);
if(resultValue != 0)
{
lr_end_transaction("Insert",LR_FAIL);
}
else
{
lr_end_transaction("Insert",LR_PASS);
userId ++;
}
变量类型转换:
itoa(count,port,10); //count转CHAR放入port变量
count = atoi(lr_eval_string("<rp>")); //取DAT文件中的端口号转化成整数型放到count变量中
变量类型转换:
itoa(count,port,10); //count转CHAR放入port变量
count = atoi(lr_eval_string("<rp>")); //取DAT文件中的端口号转化成整数型放到count变量中
标签:int between dat文件 sprint nsa 变量类型 one exe char*
原文地址:http://www.cnblogs.com/Oliver.net/p/7159967.html