Re: delete based on multipart key. It is possible.
Posted in 1997
In article <5idpll$p2g@cssun.mathcs.emory.edu>,
fmathews@systems.dhl.com (Felix Koshy Mathews) wrote:
>In <5ickgb$nqk$2@gulfa.kuwait.net>, Rudy Fernandes wrote:
<snip>
>Informix does not allow modification on table/view used in subquery, so
>I don't see how this delete will work.
You are right. I can't imagine how I goofed! (But read on for a solution)
<snip>
> If you change the select as below :
>
> select ... from first_table
> where 1 in
> (select 1 from second_table -- Notice the difference in from ....
> where first_table.a = second_table.a and
> first_table.b = second_table.b)>
> will always use the index
>
Right, again!
Now change the 'SELECT ...' of your last statement to 'DELETE'.
It works, and it uses the index.
(have now decided to re-read SQL-Tutorial!)
-----------------------
Rudy Fernandes
GIC, Kuwait
OL 7.20UC4, 4GL 6.04UC1
-----------------------