Re: sqlcmd stackdump
Posted in 2010
Just for completeness - the error might *not* be in the reading of sqlca.sqlcode after the FETCH.. You say : static void sql_select(Sqlda *idesc, int stmt_code) ... count = 0; while (sqlca.sqlcode == 0) { printf("sql_select 5\\n"); EXEC SQL FETCH c_statement USING DESCRIPTOR idesc; printf("sql_select 5.1\\n"); if (sqlca.sqlcode != 0) break; printf("sql_select 5.2\\n"); if (qlimit > 0 && count++ >= qlimit) { printf("sql_select 5.3\\n"); fflush(ctxt_output()); break; } printf("sql_select 6\\n"); if (print_record(idesc) != 0) break; printf("sql_select 7\\n"); } So - if sqlca.sqlcode!=0 - it will break out of the while, after printing the 5.1 - but we can't see any printf's after the while indicating that its done that... This might just be a c&p issue - but it might be worth adding something like : printf("sql_select 5\\n"); EXEC SQL FETCH c_statement USING DESCRIPTOR idesc; printf("sql_select 5.1\\n"); printf("sql_select 5.15 - sqlcode now : \\n",sqlca.sqlcode); and see if you get that second printf. -- Mike Aubury http://www.aubit.com/ Aubit Computing Ltd is registered in England and Wales, Number: 3112827 Registered Address : Clayton House,59 Piccadilly,Manchester,M1 2AQ