}
else if (diary.alias(words));
else {
- diary.insert(words);
+ std::vector<int> myvector (3,100);
+ vector<string>::iterator it;
+ it = words.begin();
+ it = words.insert ( it , "default");
+ diary.alias(words);
}
words.clear();
}while(1);
}
int sqlpg::insert(vector<string> text) {
clog<<"insert(vector<string>) begin\n";
-
string command="INSERT INTO raw (date, texte) VALUES ($1::timestamp, $2::text);";/*PQgetvalue(res, 0, 0);*/
clog<<"commande : "<<command<<endl;
-
string tmp="";
int argc=2;
const char * value[2];
value[0]=a.c_str();
length[0]=a.size();
binary[0]=0;
- //tmp=text[2];
value[1]=tmp.c_str();
length[1]=tmp.size();
binary[1]=0;
- //command="INSERT INTO raw (date, texte) VALUES ('now()', '"+tmp+"')";
-
};
}
else {
binary[1]=0;
clog<<"text.size()<2 finish\n";
};
- //res=PQexecParams(conn, command.c_str(), argc, NULL, value, length, binary, 0);
res=PQexecPrepared(conn, "insert", argc, value, length, binary, 0);
testSQL(res);
clog<<"insert(vector<string>) end\n";
- //exec(command);
return 0;
}
//res=PQexec(conn, command.c_str());
exec(command);
a=PQntuples(res);
- clog<<"hmRecord()="<<a<<endl;
+ //clog<<"hmRecord()="<<a<<endl;
return a;
}
void sqlpg::printvar(){