[Q] Another SQL question???
Posted in 1995
You guys have been extremely helpful, so I will have another go at this
;-)
I have constructed the following query with the help of Net God(esses).
select col1, col2, col3 from table1 where col1="xyz"
union
select col1, col2, col3 from table2 where col1="xyz"
into temp temp_table;
select temp_table.col1, temp_table.col2, temp_table.col3, table3.col1
from temp_table, table3
where temp_table.col3=table3.col1
This works fine, except the data in table3 is being continuosly updated
so I need to run this query repeatedly. That is not a problem EXCEPT,
once a TEMP table temp_table has been created, Informix gives an error
saying that the table still exists. ANY way around that????
Secondly, I can INSERT the UNION result INTO a real table and just keep
updating to it, EXCEPT all the new info will be APPENDED to temp_table,
which will make the second part of the query slow down. I can always
DELETE * from temp_table at the start, however for that I will require a
stored procedure.
If I am going to be writing a stored procedure, would this be a good way
of handling this particular query?
Thanks in advance.......
--
Saqib Mausoof
--------------------------------------------------------------------
I have a hard enough time speaking for myself, so speaking on behalf
of my employer is out of the question.