Re: SELECT INTO TEMP...
Posted in 1996
Topics: SQL Development & Query Writing, Connectivity: ESQL/C, 4GL & Embedded SQL
Carlos Palma (cap@smd.pt) wrote: : In ESQL/C what steps do you take to run this type of query : (dynamically constructed statement): : SELECT some_fields FROM table_x INTO TEMP table_y WITH NO LOG; : or : $PREPARE statement_id FROM $statement; : $EXECUTE statement_id; : or the steps used on a basic SELECT statement ? OPEN CURSOR and so on. : If I do it that way it gives me an error when opening the cursor, it : says the statement is not a select statement. I've typically always used the sprintf, PREPARE, DECLARE, and then OPEN and FETCH a cursor myself. Of course, using that route you can't have an into clause. Instead you fetch into variables. Not sure what I would do to select into a temp table. Not something I ever felt the need to do. HTH (a little anyway), Scott -- +++++++++++++++++++++++++++++++++++++++++++++++ | Scott Morizot -- tmorizot@infinity.ccsi.com | | "May you live in interesting times" | +++++++++++++++++++++++++++++++++++++++++++++++