>I take out the loop, and index both tables on the matching criteria in the where clause but when I run the updates nothing except one record updates. When I run the update in the loop everything updates properly.
Looking at a sample of your code:
UPDATE data;
SET data.trailer1=aud_trls.trailer;
WHERE ALLTRIM(data.ACCOUNT)=ALLTRIM(aud_trls.ACCOUNT) AND aud_trls.max_trail=1;
and alltrim(data.screennum)=alltrim(aud_trls.screennum);
and alltrim(data.showtime)=alltrim(aud_trls.showtime)
Why are you using alltrim() for your joins? If you were to use the contents of the WHERE clause in a SET FILTER TO command, how many records do you get? e.g.:
set filter to data.ACCOUNT = aud_trls.ACCOUNT ;
and data.screennum = aud_trls.screennum ;
and data.showtime = aud_trls.showtime ;
and aud_trls.max_trail = 1
Mark McCasland
Midlothian, TX USA