Re: Dynamic SP execution problem from ESQL/C
Posted in 1996
Look at the manual page for PREPARE. It returns 0 for a SELECT statement, a non-negative value for other statement types, and a negative value if there is an error. The header sqlstype.h contains the define: #define SQ_EXECPROC 56 /* EXECUTE PROCEDURE */ PREPARE is simply telling you that you prepared an EXECUTE PROCEDURE statement! And only negative values of sqlcode are errors! Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> }From: san@inist.ru (san) }Date: Thu, 15 Aug 1996 06:58:43 GMT }X-Informix-List-Id: <news.27134> } }I have INFORMIX ESQL/C for Windows 5.01.WF1 and INFORMIX ODS 7.10 UC1 under SCO }UNIX 3.2. I want dynamically execute stored procedure from Windows-95 client }using ESQL/C. }I have this code: }void main() }{ } $char *q_string = "EXECUTE PROCEDURE test()"; } struct sqlda *q_desc; } extern long SQLCODE; } $DATABASE test_db; } $PREPARE q_id FROM :q_string; }// SQLCODE = 56 } $DESCRIBE q_id INTO q_desc; } $DECLARE q_cursor CURSOR FOR q_id; } $OPEN q_cursor; } $FETCH q_cursor USING descriptor q_desc; } $CLOSE q_cursor; }} } }After execution of 'PREPARE' statement the SQLCODE variable sets to 56. Error }text is 'Socket is already connected'. }Is it a bag?