Re: Error -710 (We have a winner!)
Posted in 1994
In article <32r69c$ck5$1@heifetz.msen.com>,
Jeffrey Sturm <jsturm@garnet.msen.com> wrote:
>
>I have a hunch that your insert statement is being prepared by the 4GL
>program the first time through this function but not the second.
>When you try to insert again, the database engine realizes (correctly) that
>this prepared statement refers to a table that no longer exists. (A new
>table with the same name DOES exists however.)
>
>You could try coding the insert statement as a text string and preparing it
>each time you create the table:
>
> CREATE TEMP TABLE table-name (table-columns ...)> LET sql_text = "INSERT INTO table-name VALUES (...)"
> PREPARE sql_stmt FROM sql_text
>
>Then you can load the table with a series of EXECUTE sql_stmt USING ...
>commands. You might also have to explicitly prepare your DROP TABLE
>statement. Let me know if this works for you.
Jeff,
Tried it and IT WORKS! Does this mean that the insert statement is
internally prepared somewhere and subsequently re-used in an effort by
Informix to recognize identical sql statements? If so, it obviously
doesn't work sometimes. I say sometimes, since I have had my program
work a couple times and a simplified one I made as a test program did
not produce the error. This is even more interesting, since outside of
R4GL (i.e. using c4gl) the problem also disappears. How come the p-code
version exhibits this problem and not the compiled version?
Lot of questions, but the main thing is that you seem to have gotten
to the root cause of the problem. Sorry there isn't a prize or
something, but kudos to you and thanks.
----------------------
Dave Black Idaho National Engineering Laboratory
daveb@dune.inel.gov Westinghouse Idaho Nuclear Company, Inc.
(208) 526-3355 Idaho Falls, ID