Re: Problem: Error -710
Posted in 1994
Dave Black (daveb@pmafire.inel.gov) wrote:
...
: I have a function that creates a temporary table, inserts some records,
: and then uses it in a join with another table. Just before the function
: returns the temp table is dropped (i.e. I drop it with the drop
: command). So far, so good. But when a call is made a second time to my
: function (same invocation of the main routine, however) it generates
: the following error on the first insert into the temp table:
: Program stopped at "sel_out2.4gl", line number 115.
: SQL statement error number -710.
: Table (daveb.pref_pr) has been dropped, altered or renamed.
: Any Ideas? Thanks
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.
Regards,
Jeff Sturm