Prepare, Free statement id's
Posted in 1997
In the V.6 Sql Reference manual, under the description of the "FREE" command, it says (among other things) that after you free a prepared statement id, you can't open a cursor that was prepared with that statement id. I've just run across some code (while looking for some mysterious error) that has alot of prepares in the beginning like so: let sel_stmt="select ...." prepare sel_stmt_id from sel_str declare sel_cursor cursor for sel_stmt free sel_stmt_id and then later the cursors are used. There aren't any obvious errors, but I was wondering if either the manual was hogwash (not the whole thing, just the referenced part), or if there should be an error generated when opening the cursor, or if this might be the cause of some not so obvious error. I called Informix tech support, he didn't know, and I was wondering if anyone did know. I was also wondering if there was any benefit to freeing the statement id; the modules not very large, there's only about 50 select statements in the whole thing, I'd think that you could leave them all as open cursors if you wanted to.