Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memory and VFP 9 - more memory=slower???
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows Server 2003
Network:
Windows 2003 Server
Miscellaneous
Thread ID:
01183184
Message ID:
01183778
Views:
18
If I understand correctly you move data from foreign source, change it in VFP and then move back to the source? Does this 'source' have any kind of own processing capabilities, like stored procedures?

>>Mike,
>>
>>In your original you say "I am moving data from one system to another via ODBC. (Both systems are not directly compatable.)".
>>
>>Is this data sitting in a non-VFP table, or is it VFP-style data? I think we (well, me anyway) have been assuming that you were talking about VFP data here.
>-------------------
>Sorry, I wasn't clear here. The data is not VFP data. It is some form of propietary file format... looks like text delimited, but there are control characters at the start... The product supplies ODBC drivers for each. Since one system has differnet field names than the other ,and sometimes the data type has changed, I need to marry the fields and move them over.
>
>i.e.
>Job_No is now Job
>Cust_no is now Customer
>
>Some fields were smallint data type are now int, etc.
>
>All of these are taken care of in the routine that gets the lcValueList
>----------------------
>
>So basically I'm asking is there anyway, via parameters for the /sql or otherwise to speed up this transfer. I really am starting to believe the stumbling block is the ODBC drivers, not my code.
>
>Mike
>
>
>>
>>>To the people looking for code on how I do this:
>>>
>>>The read is thus:
>>>lcTableName is the name of the table I want to get the data from
>>>lnAgamaHandle is the handle returned by the opening of the AgamaLink
>>>lnResult is the result from the query, to trap for errors.
>>>lcSql is the SQL string to execute
>>>
>>>lcSql='SELECT * FROM '+lcTableName
>>>lnResult=SQLEXEC(lnAgamaHandle,lcSql,'Agama')
>>>
>>>To get the value for lnAgamaHandle
>>>
>>>SQLSETPROP(0,'DispLogin',3) && No Password req'd
>>>lnAgamaHandle=SQLCONNECT('Agama','DBA','')
>>>
>>>
>>>The above SQLEXEC command takes about 2 hours to execute to get about 27,000 records. AS you state, this is unacceptable.
>>>
>>>------------------
>>>After the data is retrieved, I have a translation table that holds the source field name, source table, target field name and target table. I run a routine that places the field names into a 2 dimesional array, first column is the source, second is the target. This the list of fields for the SQL INSERT command. (It is only run once.)
>>>i.e. lcFieldList
>>>lnSysproHandle is gotten in a similar manner to the lnAgamaHandle above.
>>>lcSql is the insert command to be executed
>>>lcValueList is the values to insert.
>>>lcTgtTable is table to insert into
>>>
>>>Then I run through the source table, the result of the first query.
>>>
>>>Example of the code is below
>>>lcFieldList=GetFieldList()
>>>Select Agama
>>>SCAN
>>> scatter memvar
>>> * GetValues is a routine that translates the memvars to the data for the new system.
>>> lcValueList=GetValues()
>>> lcSql='INSERT INTO '
>>> lcSql=lcSql+lcTgtTable+' ('+ALLTRIM(lcFieldList)+') '
>>> lcSql=lcSql+'VALUES ('+lcValueList+') '
>>> *- Now Write Data To Target Table - lnResult to handle errors
>>> lnResult=SQLEXEC(lnSysproHandle,lcSQL)
>>>ENDSCAN
>>>
>>>This usually takes about 1/2 or less time to execute than the read above.
>>>
>>>
>>>Is there anything else I could do to optimize/improve the speed of retrieval and write?
>>>
>>>TIA,
>>>Mike
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform