Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return MEMO data w/ SQL query?
Message
From
24/04/2000 00:21:12
 
 
To
23/04/2000 14:03:43
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00362604
Message ID:
00362674
Views:
19
Tom,

>I must retreive data from an existing database where they are in both character and memo fields (data-plural, datum-singular), and then export them to a text file while delimited as a character field within each record. The memo data are less than 256 characters in each instance...

You can pull the data into a temporary cursor with a SQL SELECT command, using the PADR() function to transform the memo field into a character-type field of fixed width to assure getting all the data, then output from there to a delimited file.

This will give you just the first 254 chars of the memo, but will work:
field1     C 10
field2     C 10
memofield  M

SELECT field1, field2, PADR(memofield,254) AS wasmemo ;
  FROM mytable ;
  INTO CURSOR temp ;
 WHERE field1 = somecondition
* create comma-delimited file
COPY TO newfile TYPE DELIMITED
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Reply
Map
View

Click here to load this message in the networking platform