Problems with dynamic SQL statements in ESQL/C
Posted in 1995
Hi, i've some strange problems with dynamic SQL statements in an ESQL/C module. I've files with first line contains table name and table columns, the following lines contains the data rows. I'm reading the first line, create the INSERT statement from the first line, prepare a (hold) cursor and describe the statement into a descriptor. I'm allocating memory for the data rows as the examples in the doc's show. Then i'm reading the data rows, putting them into the rigth places in the buffer and inserting them into the database. The insert procedure works within a transaction. Every 400 rows there is a commit and begin work. After inserting all rows, the cursor is freed as long as the memory occupied by the descriptor. Everything works fine until i tried to load more than one table in the same run. If i tried this, i get an error 1207 on the first insert operation for the second table. This error is definitaley wrong. Everything is ok with the data. And the problem doesn't occur if i load the tables in separate runs. So, my question is: Did i forget to deallocate something so that the database engine has something left from the last prepare/Describe in memory? Greetings, Joerg P.S. I'm working with Online 5.01 on a SNI RM400