Unix Technical Forum

Error 206 during insert with ESQL/C

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 ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 10:06 AM
Bispo
 
Posts: n/a
Default Error 206 during insert with ESQL/C

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2008, 10:07 AM
david@smooth1.co.uk
 
Posts: n/a
Default Re: Error 206 during insert with ESQL/C


What does the manual say ISAM error number 111 means?

On a UNIX system run

finderr 111

....

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-20-2008, 10:07 AM
Bispo
 
Posts: n/a
Default Re: Error 206 during insert with ESQL/C


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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-20-2008, 10:07 AM
david@smooth1.co.uk
 
Posts: n/a
Default Re: Error 206 during insert with ESQL/C


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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:17 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com