Re: Table lookup function in isql?
Posted in 1992
Topics: SQL Development & Query Writing, Connectivity: ESQL/C, 4GL & Embedded SQL, Migration, Import/Export & Data Conversion
In article <62980009@col.hp.com> judym@col.hp.com (Judy Miller) writes:
>Question: Is there some kind of table lookup feature in isql
> (Informix SQL Query Language)?
>
>Problem: I have a list of keys to 4000 records which I need to delete from
> a table of 12000.
>
>I'm trying to avoid writing a program for this common function.
>(I do not have 4GL on this machine, but I do have ESQL/C.)
>
>Another option is to unload the table and eliminated the records outside of
>Informix, delete all, and then reload the remaining two-thirds.
>
>Judy
>
If I understand your question correctly you have 4000 key values in some
file or table, and you want to delete all the rows in this 12000 row
table which contain any of the 4000 keys.
You could issue a delete something like this one from SQL query language:
delete from big_table where key in (select key from tmp_keys_table);
--
/|| // // ,'/""\\' John Postma john@mks.com (519)884-2251
/ ||/// //\\' `\\\\\\ Database Administrator, Mortice Kern Systems Inc.
/ |/ /_// \\\\___/ 35 King St. N., Waterloo, Ont., Can. N2J 2W9
o/ "Things are only impossible until they're not!" -- Capt Jean Luc Picard