Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table driven field mapping for data conversion.
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00223100
Message ID:
00223253
Views:
22
>John,
>
>You can use macro substitution. One thing to keep in mind is that macro substitution works only with memory variables, not with fields. So you might do something like this:
>
>m.lcReplace='REPLACE '+mytable.SourceField+' WITH '+mytable.Protocol
>&lcReplace
Hope this helps.
>

OTOH, name substitution works just fine in the REPLACE statement; coupled with the EVAL() function, you get nice, clean code like:

REPLACE (mytable.SourceField) WITH EVAL(myTable.Protocol)

>>I am working on doing routine data imports from remote systems utilizing two data structures that are different from the local data structures, and cannot be changed.
>>
>>As a result, we have to map the incoming data to match the local fields, possibly performing some other manipulations. Currently, this mapping is hardcoded into the import routines.
>>
>>What I would like to do is drive the mapping out of a table. The MAPTABLE will contain the source table and fieldnames, the destination table and fieldnames, and the mapping protocol. For example, a last name may come over from field "last_name" all in UPPER case. I want to put it into "name1l", in PROPER case. The map protocol would look like this : PROPER(sourcetable.last_name)
>>
>>How do I get this to work in code, where the procedure/method/function reads the protocol and then applies it?
>>
>>Thanks,
>>
>>John
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform