UniverseUniversity


Home Projects Jobs Clientele Contact

uu


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UU code



The problem is that you have to use stored procedures.

sergey@total-knowledge.com wrote:
> This question is to Alexey.
>
> I have a strange problem with session_info table: I can't make inserts
> work from C++. Works fine if I do it manually.
> Here is the error message that I get:
>
> Error: Exception in CODBCDatabase::queryExecute: Error while executing the
> query (non-fatal);
>
> Here is my code:
> ------------
> bool User::setSessionInfo ( std::string login) {
>  CODBCDatabase db("DSN=PostgreSQL;UID=sergey;PWD=;DATABASE=uudb");
>   try {
>     db.open();
>     CQuery qryInsert(&db,"insert into session_info select pl_id, 
> pl_first_name || ' ' || pl_last_name from person_list where
> pl_login='"+login+"';");
>     qryInsert.exec();
>     db.close();
>   }
>   catch (exception& e) {
>     cout<<"\nError: " <<e.what();
>     return false;
>   }
>   return true;
> }
> -------------
>
> I did 'grant all on session_info' manually. What do you think the problem is?
> Also there is no constrain on si_person, are we going to have stored
> procedure that will do this insert/update?
>
>
>
>   

-- 
Ilya A. Volynets-Evenbakh
Total Knowledge. CTO
http://www.total-knowledge.com


Authoright © Total Knowledge: 2001-2008