I want to write an application using the C precompiler, with the code organized into several separate files. One of the .pc files will configure error and warning handlers and connect to the database. Another .pc file will have the routines to define a cursor, open it with specific parameters, fetch from it, close it and dispose of it; each cursor should go onto a separate .pc file.
I have been unable to make this run. The error and warning handlers that I define in the first .pc file (which definition gets called before any other DB-related functions) are only used for that one .pc file; any errors triggered from the other .pc files are not funneled through these handlers.
I believe this is related to the INCLUDE SQLCA instruction; I guess I should only use that in a single .pc file, and do some other incantation from the other .pc files, but I have been unable to make this work. The only way everything compiles and runs is to have an INCLUDE SQLCA in each .pc file; since that generates an "SQLCA sqlca;" line in each generated .c file, it seems that, unless I am mistaken, each .c file is getting a separate instance of SQLCA.
Any help greatly appreciated. Thanks in advance.
Last edited by gonzus; 06-17-14 at 12:32.