Haszlakiewicz, Eric wrote:
> So, instead I tried using the libpq interface:
>
> struct connection *ecpg_conn = ECPGget_connection(NULL);
> PGconn *conn = ecpg_conn->connection;
> Oid deallocTypes[] = { VARCHAROID };
> const char *deallocValues[] = { stmtName };
> int deallocLengths[] = { strlen(stmtName) } ;
> int deallocFormats[] = { 0 } ;
>
> PGresult *dealloc_result;
> dealloc_result = PQexecParams(conn, "DEALLOCATE $1", 1, deallocTypes,
> deallocValues, deallocLengths, deallocFormats, 1);
>
> But I get this error:
> syntax error at or near "$1" at character 12
The prepared statement's name is not a literal, and in general
parameterized queries don't accept parameters beyond literals. So you
need to insert the name directly into the SQL command text.
Best regards,
-- DanielPostgreSQL-powered mail user agent and storage:
http://www.manitou-mail.org