Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to write data from memo field from one file to a memo field in a different file?

Status
Not open for further replies.

mfrag44

Programmer
Jun 14, 2016
5
US
I am trying to create a new file from fields extracted from a larger file that contains two memo fields. I wrote a sql program that queries and extracts the fields I need for my new file. The routine works fine except the two memo fields are empty. Does anyone have a solution?

SELECT Service.sproblem, Service.swrkst, Service.smec_num, Service.misc2,;
Service.svcorder, Service.custcode, Employee.last, Employee.Emplcode;
FROM sds!service, sds!Employee;
WHERE Employee.Emplcode = Service.smec_num ;
ORDER BY Service.custcode, Service.svcorder, Service.swrkst ;
into dbf TMPSERV.dbf readwrite

SELECT TMPSERV
SCAN
M.SPROBLEM = TMPSERV.SPROBLEM
M.swrkst = TMPSERV.swrkst
M.smec_num = TMPSERV.smec_num
M.MISC2 = TMPSERV.MISC2
M.svcorder = TMPSERV.svcorder
M.CUSTCODE = TMPSERV.CUSTCODE
M.EMP_LAST = TMPSERV.LAST
SELECT MBLSERV
GO BOTTOM
APPEND BLANK
GATHER MEMVAR
=TABLEUPDATE(.T.)
SELECT TMPSERV
ENDSCAN
 
Hi Olaf

That's a nice tip SCANEND[ENTER] works too.

I usually design my tables to have indexes on the fields I'm going to need to limit my DO WHILE loops to... so I'd be surprised if Rushmore give any advantage over that.


Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
I again don't understand your logic. Index are the basis for rushmore to work. In themelves they optimize nothing, unless you acitvely or inactively make use of them. Automatic usage occurs in WHERE somecondition, for example, or in SCAN FOR somecondition, but not in DO WHILE NOT EOF() .AND. somecondition. Just like IF somecondition also isn't rushmore optimized. In both these cases somecondition is evaluated on the current record only and no index is used for that, just the access to the current records fields.

The only effect a SET ORDER has is determining the order of scanning records, that's also true for SCAN ENDSCAN. In short SCAN ENDSCAN has no disadvantage.

Another use of an index would be by SET KEY TO, and what can be used as the aftermath of that? SCAN ENDSCAN!

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top