Re: "UPDATE" format, need help
Posted in 1995
Although I hate to disagree with someone as experienced as Jonathon Leffler I feel I should warn everybody. The soultion he is proposing involves the use of a correlated sub-query. These can be notoriously inefficient. In the example the subselect would have to be performed for every record in metrcv. Not a good idea?? > In article <434g8g$sit@cssun.mathcs.emory.edu> > johnl@informix.com "Jonathan Leffler" writes: > > > (1) You cannot have ORDER BY clauses in FOR UPDATE cursors. > > (2) You cannot have joins in FOR UPDATE cursors. > > (3) You should be able to do the whole thing in one statement, which > > should be more cost-effective -- less traffic between application > > and database. > > > > UPDATE metrcv > > SET (nr_frcv_dt, nr_frcv_tm) = > > ((SELECT metcls.nc_log_dt, metcls.nc_log_tm > > FROM metcls > > WHERE metcls.nc_contact_id = > metrcv.nr_contact_id)) > > The master has spoken! :-) And as elegant as eloquent! > > Cheers, > > Spokey the > Wheeler------------------------------------------------------------- > > "Billy Boy" - das aufregend andere kondom! > Malcolm Weallans Online Database Consultancy Phone 0628-72154 Fax 0628-37463 CIX - onlinedbc