I have a database (Oracle8) with two tables of street addresses one of which is updated by another department. The other department uses abbrevations for Street, Avenue, etc. My table does not. I'm trying to generate a report with CR9 of differences in names and numbers only (i.e. - 123 Stetson Road vs 123 Stetson Rd)
The code I'm trying to use is -
LOCAL numberVar X:=1;
WHILE X=1 DO
(X:=0;
(IF InStr ({C.ADDR}, ' ST') <> 0 THEN
(X:=1;
IF Mid ({C.ADDR}, InStr ({C.ADDR}, ' ST'))=' ST' THEN
Replace ({C.ADDR}, ' ST', ' STREET')
ELSE
Replace ({C.ADDR}, ' ST', ' STREET ');
)
ELSE
IF InStr ({C.ADDR}, ' RD') <> 0 THEN
(X:=1;
IF Mid ({C.ADDR}, InStr ({C.ADDR}, ' RD'))=' RD' THEN
Replace ({C.ADDR}, ' RD', ' ROAD')
ELSE
Replace ({C.ADDR}, ' RD', ' ROAD ')
)
))
I get the Error Message - The loop was evaluated more than the maximum number of times allowed.
I think I get the Error because every cycle of the loop reinitializes the {C.ADDR}. I'm stumped as to how to keep the changes made on each iteration.
Any help would be greatly appreciated.
The code I'm trying to use is -
LOCAL numberVar X:=1;
WHILE X=1 DO
(X:=0;
(IF InStr ({C.ADDR}, ' ST') <> 0 THEN
(X:=1;
IF Mid ({C.ADDR}, InStr ({C.ADDR}, ' ST'))=' ST' THEN
Replace ({C.ADDR}, ' ST', ' STREET')
ELSE
Replace ({C.ADDR}, ' ST', ' STREET ');
)
ELSE
IF InStr ({C.ADDR}, ' RD') <> 0 THEN
(X:=1;
IF Mid ({C.ADDR}, InStr ({C.ADDR}, ' RD'))=' RD' THEN
Replace ({C.ADDR}, ' RD', ' ROAD')
ELSE
Replace ({C.ADDR}, ' RD', ' ROAD ')
)
))
I get the Error Message - The loop was evaluated more than the maximum number of times allowed.
I think I get the Error because every cycle of the loop reinitializes the {C.ADDR}. I'm stumped as to how to keep the changes made on each iteration.
Any help would be greatly appreciated.