I have a CRecordSet (Visual C++ 6.0) and I'm using ODBC to connect to postgresql 8.0.8.
__
The problem: I insert a row into a table with a serial id (autoincrement), and I would like to retrieve the id after my insert.
I can't use the RETURNING keyword, not supported on this version of PGsql, but I can use currval('sequence').
However, in my code, I need to execute the default query and then override it to execute the query with currval().
From what I understand, I can only override the query by calling CRecordSet::Open() again, which would create a new session, rendering currval() useless.
__
So: How can I override the SQL, then execute this new query via a Requery() and not via Open()?