cossy74
asked on
Postgres and bytea
Hi,
Below is the table in postgreSQL:
//------------------------ ---
// tblUsers
//------------------------ ---
// user_id int
// csv_data bytea
// image bytea
//------------------------ ---
My question is using c++, what is the code for inserting and retrieving a row from the table defined above?
NOTES - What i have discovered ( I may be wrong ):
1) I think the sql query needs to be "INSERT INTO tblUsers values ($1, $2, $3);"
2) In my understanding( which i very limited), i have to use pqxx::prepare::declaration to declare a parameter, but i am unsure of how to add mulitple parameters.
3) After the declaration, i believe i have to use prepare::invocation to assign the value of the parameters.
4) Finally i believe i need to call the execute on the invocation.
Below is the table in postgreSQL:
//------------------------
// tblUsers
//------------------------
// user_id int
// csv_data bytea
// image bytea
//------------------------
My question is using c++, what is the code for inserting and retrieving a row from the table defined above?
NOTES - What i have discovered ( I may be wrong ):
1) I think the sql query needs to be "INSERT INTO tblUsers values ($1, $2, $3);"
2) In my understanding( which i very limited), i have to use pqxx::prepare::declaration
3) After the declaration, i believe i have to use prepare::invocation to assign the value of the parameters.
4) Finally i believe i need to call the execute on the invocation.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.