Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return MEMO data w/ SQL query?
Message
De
24/04/2000 00:21:12
 
 
À
23/04/2000 14:03:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00362604
Message ID:
00362674
Vues:
18
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform