我使用libpqxx在 C++ 中连接到 PostgreSQL DB。我想加密一列表并将其替换为当前列。我写这个:
int num;
cout << "Select Your COLUMN Number For Encryption: ";
cin >> num;
/* Create SQL statement */
sql = "SELECT * from " + tbName;
/* Execute SQL query */
result R3( N.exec( sql ));
/* List down all the records */
for (result::const_iterator c = R3.begin(); c != R3.end(); ++c) {
c[num].as<string>() = encnum->encryptionData(3,5,c[num].as<int>());
cout << "Encryption = " << c[num].as<string>() << endl;
}
但结果就像加密之前一样。我有什么问题,如何将值替换为列中的其他值?