SQL help
Posted in 2003
Topics: General Discussion
Is there another way to use a FROM clause in an UPDATE statement on IDS ? I found out that in a XPS this can be done but IDS don't support this option. ON XPS: UPDATE tab1 SET tab1.a = tab2.a FROM tab1,tab2,tab3 WHERE tab1.b = tab2.b and tab2.c = tab3.c Has somebody has done something similar on an IDS ? I tried updating my field by using a VIEW. I'm having problem using the VIEW because is not a single-table view and it don't allow me to update the field. Thanks for the help. Ed
Ed, Without knowing versions, how about a correlated subquery. UPDATE tab1 SET tab1.a = (SELECT tab2.a FROM tab2, tab3 WHERE tab1.b = tab2.b AND tab2.c = tab3.c) HTH, Zev Berezin Informix DBA B&H Photo www.bhphoto.com On 31 Mar 2003, at 14:40, Gonzalez, E.... wrote: > Is there another way to use a FROM clause in an UPDATE statement on > IDS ? I found out that in a XPS this can be done but IDS don't > support this option. > > > ON XPS: > UPDATE tab1 > SET tab1.a = tab2.a > FROM tab1,tab2,tab3 > WHERE tab1.b = tab2.b and tab2.c = tab3.c > > > Has somebody has done something similar on an IDS ? I tried updating > my field by using a VIEW. I'm having problem using the VIEW because > is not a single-table view and it don't allow me to update the field. > > > > Thanks for the help. > > Ed > >