This is a discussion on Error 206 during insert with ESQL/C within the Informix forums, part of the Database Server Software category; --> I created a small ESQL/C program to colect data from some system catalog tables, do some calculations and insert ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I created a small ESQL/C program to colect data from some system catalog tables, do some calculations and insert the results in a table on another database for monitoring and historial purposes. Basically, the program does some colects and put in a temp table. When the program does the calculation from the temp table, it fetches the result rows to variables and uses them to insert in another table. But sometimes the insert operation fails with the SQL Error 206 and the ISAM Error 111 and I did not find out why. Here is the insert code: EXEC SQL DECLARE topcol_cursor CURSOR FOR topcol_sql; EXEC SQL OPEN topcol_cursor; for (; EXEC SQL FETCH topcol_cursor INTO :v_mas_sid, :v_mas_username, :v_mas_cpu_perc, :v_mas_tty; if (sqlca.sqlcode == 100 || v_rank > 5) break; EXEC SQL insert into mostactsess values ("TODAY",:str_hora,:v_rank,:v_mas_username,:v_mas_ sid,:v_mas_tty,:v_mas_cpu_perc); if (sqlca.sqlcode != 0) { fprintf( stderr, "Error: %d(%d) in the INSERT.\n", sqlca.sqlcode, sqlca.sqlerrd[1]); return 7; } v_rank++; } --------------------------------- Environment: OS: AIX 5.3 RDBMS: IDS 7.31.UD1X5 ESQL: 9.40.UC2 (CSDK 2.50.UC2) Any help is welcomed. Best regards. Eduardo A. Bispo |
| |||
| david@smooth1.co.uk escreveu: > What does the manual say ISAM error number 111 means? > > On a UNIX system run > > finderr 111 > > ... The 206 error says: -206 The specified table <table-name> is not in the database. And the 111 error says: -111 ISAM error: no record found. The ISAM processor cannot locate the requested record. For C-ISAM programs, no record was found with the requested index value or record number, depending on the retrieval mode in use. Make sure that the correct index is in use. For SQL products, see the SQL error message or return code. Probably no row was found for this query. The tables (the temp and the regular) are there and if the returned record set is empty the program is suposed to stop the loop for. I do not know why this error. Regards Eduardo. |
| ||||
| Informix will not say the table is not there when it is. You must be connected to the wrong database. (perhaps the wrong instance)? Or the table has not been created at the table the code runs orthe table has been dropped by another session at that time. Create a dummy table with a unique name in the database you should be accessing and try to insert into that. That will show if you are connected to the right database. |