I'm developing a C++ program for Vertica 6 on Windows/MSVC. I'm using libpq compiled off the Postgres 9 source. Connection and simple statements are working fine. But when I try to pass a parameter, I'm getting: "ERROR: Insufficient data left in message".
Here is code:
string sCommandText("SELECT * FROM columns WHERE table_name=?");
char preparedQueryName[16] = "q1234567890abcd";
PQresult* res = ::PQprepare(conn, preparedQueryName, sCommandText.c_str(), nParams, paramTypes);
if (::PQresultStatus(res) == PGRES_COMMAND_OK || strcmp(::PQresultErrorField(res, PG_DIAG_SQLSTATE), "42P05") == 0) {
::PQclear(res);
res = ::PQexecPrepared(conn, preparedQueryName, nParams, paramValues, paramLengths, paramFormats);
}
Can libpq from Postgres be used for Vertica, or should I use special libpq designed for Vertica?
Thanks!
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.