[SQL ] c++ 批量輸入MySQL
資料庫名稱:MySQL
資料庫版本:Ubuntu 系統
內容/問題描述:批量insert 使用c++ 實作幫我看看哪裡有問題
code (主要是str裡面的東西送到令一個函式輸入)我每100筆丟過去
-------------------------
int count=0;
string str;
typedef double* DynamicMatrix[l+m];
// DynamicMatrix Count;
typedef double* DynamicMatrix2[l+m];
//DynamicMatrix2 Prob;
for(int i=0; i<(l+m); i++)
{
for(int j=0; j<(l+m); j++)
{
//--------------------------------------------------
if (count <= 100)
{
// concatinate the string with prev str
str += ' (i,j,combine[i],combine[j])'+',';
}
if (count ==100 || count == 0)
{
// execute the string
mysqlinsert(str);
// initialize str as empty string
str = 'INSERT INTO EM (
sourceindex,targetindex,source,target) VALUES';
count = 0;
}
}
}
--------------------------------------------------------
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 163.22.21.92
※ 文章網址: http://www.ptt.cc/bbs/Database/M.1412246058.A.C76.html
推
10/02 18:35, , 1F
10/02 18:35, 1F
推
10/02 18:36, , 2F
10/02 18:36, 2F
→
10/03 09:20, , 3F
10/03 09:20, 3F
→
10/03 15:29, , 4F
10/03 15:29, 4F
→
10/03 15:30, , 5F
10/03 15:30, 5F
Database 近期熱門文章
PTT數位生活區 即時熱門文章