How to extract to permanent table?
Posted in 1991
Path: emory!wupost!sdd.hp.com!hp-col!col!judym From: judym@col.hp.com (Judy Miller) Newsgroups: comp.databases.informix Message-ID: <62980001@col.hp.com> Date: 7 Nov 91 15:50:51 GMT Organization: HP Colorado Springs Division INTRO: I support an application using an Informix 4.0 database. I've had no formal training in Informix ISQL. I have used RBASE, so I'm used to the RBASE commands PROJECT, APPEND, UNION, INTERSECT, SUBTRACT and JOIN which actually build new tables. QUESTION: How should I extract info into a permanent table using the SQL in Informix? The only table operations I see are CREATE, DROP and SELECT INTO TEMP. DETAIL: I have a shell script which first selects information into a TEMP table and then runs an ace report: isql < my_select.sql sacego -q my_report.arc I need the table to be permanent, not temporary, or the sacego will fail. My solution was to CREATE a permanent table once. I then expanded the my_select.sql so that it creates the TEMP table as before, then DELETEs all records the the permanent table, and then INSERTs all the records from the TEMP table into the permanent table. Is this the way SQL is designed to work? If not, please direct me to the place in the manual or some SQL book which helps explain how to do it. If so, is it better to create the table once, and then delete records, or should I drop and re-create the table each time this script is run? P.S. My other sources of information (besides the INFORMIX manuals) have been the Ingres SQL CBT (Computer Based Training) and the QUE book entitled "USING SQL". Judy Miller, HP