Score:0

unixODBC SQLFetch infinite loop after INSERT statement

et flag

I'm trying to work with unixODBC and a SAP Hana database, and created a simple C program to INSERT/SELECT into the database. My problem is, if I use for example

SQLExecDirect(stmt, "SELECT * FROM NEWTABLE;", SQL_NTS);
while ((ret = SQLFetch(stmt)) == SQL_SUCCESS) {
       ...
}

It works perfectly, but if I do an INSERT statement like:

SQLExecDirect(stmt, "INSERT INTO NEWTABLE VALUES ('test');", SQL_NTS);
while ((ret = SQLFetch(stmt)) == SQL_SUCCESS) {
       ...
}

SQLFetch always returns SQL_SUCCESS, and the while loop never ends. Anybody has faced this issue? Is it some extra configuration needed that I'm missing?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.