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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

memo field scatter memvar & insert, no data

Status
Not open for further replies.
Joined
Sep 17, 2001
Messages
673
Location
US
I am using scatter memvar to take data from a cursor and insert it into a dbf in a database. The problem is when I look in the memo field copied to the table there is no data. Is there a way to transfer the data in the memo field by using scatter memvar and insert?

Code:
SELECT Ctest
GO TOP
SCAN
SCATTER MEMVAR
INSERT INTO test FROM MEMVAR
ENDSCAN
 
The syntax when you have a memo is:
SCATTER MEMVAR MEMO
GATHER MEMVAR MEMO
 
Robsutonjr,
As mgagnon suggests, you need to add the MEMO clause. As one other step, I would suggest creating a named object to hold the contents. This seems like a minor point, at this stage, but as you become more familiar with VFP, you it will make sense to you. From a syntactical standpoint, it would look like this:

SCATTER MEMVER MEMO NAME oMemVarScatter

then, to gather, use:

GATHER MEMVAR NAME oMemVarScatter MEMO

you can then use

release oMemVarScatter to clean up your environment. This is nice, as it helps keep things neet, clean, and no "Rogue" variable values floating around to cause problems elsewhere. This keeps them nice, self contained, and managable.
Best Regards,
Scott

Please let me know if this has helped [hammer]
 
If you're using the NAME clause, you need to leave MEMVAR out. The command:
[tt]
SCATTER MEMVER MEMO NAME oMemVarScatter
[/tt]
will still create variables instead of the object. You should just put this instead:
[tt]
SCATTER MEMO NAME oMemVarScatter
[/tt]
Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top