Informix - select from a temp table created in a 4gl with Interactive debugger?

909 views Asked by At

Got a lot of 4gl to debug lately, most of which use lots of temp tables. Using the "interactive" debugger, I can break after the insert into tmp_table. And I would like to do a select * query on that tmp_table, is that possible in the interactive debugger?

Or how to do it on a 3rd party sql client? A simple select * from tmp_table would result in Error: The specified table (tmp_table) is not in the database. (State:S0002, Native Code: FFFFFF32)

1

There are 1 answers

3
fourjs.reuben On BEST ANSWER

On a similar approach to what Jonathan describes, at a previous workplace, we had a library function with a name similar to FUNCTION dump_temp_table(tablename) that took as an argument a tablename and unloaded that table to the file tablename.unl. You simply called that function from the debugger using the call command passing the tablename you were interested in as an argument

Using Genero I was quickly able to recreate with the following ...

FUNCTION dump_temp_table(tablename)
DEFINE tablename STRING
DEFINE filename STRING
DEFINE sql STRING

   LET sql = SFMT("SELECT * FROM %1",tablename)
   LET filename = SFMT("%1.unl", tablename)
   UNLOAD TO filename sql
END FUNCTION

... if using 4gl you should be able to come up with something similar (replacing the modernized Genero syntax such as STRING and SFMT with CHAR etc)