Re: -404 on OPEN cursor (stupid Informix!!!!)
Posted in 1997
I refined the problem to 2 very small source modules which exhibited the same behavior. To re-confirm there was nothing wrong with the EC, I added a main which called the function w/ the error and compiled it by itself. It ran fine with no errors. Then I just happened to compile the old program with c4gl instead of esql: c4gl -c bug_ec.ec -o bug_ec.o c4gl -c bug_4gl.4gl -o bug_4gl.o c4gl -s bug_ec.o bug_4gl.o -o buggy (previous compiles had esql -c bug_ec.ec -o bug_ec.o). SO, I see 2 possible explanations: 1: esql cannot be used for compiling ec modules which are linked into 4GL modules (If this is the case, why did the PREPARE not fail?; ALSO if this is the case Informix should have at least given me a compile time error a la "incompatible object files" or some such BS) 2: Informix has a problem. Gee, either way I blame Informix. Can anyone justify this behavior? First thing I'm going to do at work tomorrow is find which Informix manual covers this and read it, but I still think it's ridiculous to have to do so, and I'm not looking forward to trying to find the right manual (Informix just knows how to write a manual so that no matter which one you pick up, the answers always in the one left on the shelf.) Daniel Wright wrote: > > This is either something really stupid on my part, or a real problem. > > I prepare a select statement > (SQLCODE == 0) after the prepare > I Declare a cursor for the prepared statement > (SQLCODE == 0) after the declare > I OPEN the cursor I just declared > SQLCODE == -404 (Cursor not available) > > I triple checked that the cursor name I tried to open was the same as > the one I declared, and did the same for the statement I prepared and > declared the cursor from. > > Any ideas will be most appreciated, > > (The cursor appears in an ESQL/C module which is compiled along with a > 4GL module into an executable - the cursor is in the E/C because that's > where the variables I intend to use exist; > I wrote a short EC program to verify that I was preparing, declaring > and opening properly; > HP-UX 10; Informix 7.21)