Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multichanges to a table
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00614296
Message ID:
00614301
Views:
21
What about just...
REPLACE ALL acct_id WITH SUBS(acct_num,1,3)+'10001' FOR
substr(acct_id,3,2) = '10'


>hey everyone,
>i am trying to make multiple changes to a table. what i have is a table that needs to be update for many instances. for instance, i have a table that holds all accounting id's which need to be updated from 2 digits to 5 digits.
>
>example:
>ap10, ar10, gl10 needs to be updated to ap10001, ar10001, gl10001 along with other ap's, ar's, etc..
>
>here is what i have tried:
>select a_acct
> acct_num = substr(acct->id,3,2)
>
>scan
> do case
> case acct_num = 10
> nRec_no = rec()
> update a_acct set acct->id = 10001 where nRec_no = rec()
> case acct_num = something else
> do same thing pretty much
> endcase
>loop
>endscan
>
>The problem is once the first condition is satisfied, the program jumps out of the case and scan and ends. my question is, how do i code it so that it not only fixes the first condition that is satisfied but all conditions. that is so that it not only solves for ap10 but also for ar10, gl10, etc.. does anyone have any suggestions on how to clean up this code? thanks.
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown
Previous
Reply
Map
View

Click here to load this message in the networking platform