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

2.6 table to comma delimted with memo?

Status
Not open for further replies.

tonedef

Programmer
May 24, 1999
64
US
I have a FPW 2.6 table that contains a memo field.&nbsp;&nbsp;I was trying to use the copy to .. delimited command to export the data to a comma delimited file so that I could then use ORACLE's SQLLDR to get the data into ORACLE.&nbsp;&nbsp;However when a memo field is encountered it is simply ignored by FPW.&nbsp;&nbsp;I doesn't even put a comma out so that I can import the data minus the comments.&nbsp;&nbsp;All of my data will be shifted one field to the left when I import since the comments are missing.&nbsp;&nbsp;I was hoping to avoid walking through the table and doing a PUT of each field to a text file.&nbsp;&nbsp;This will take quite a long time.&nbsp;&nbsp;Any help would be appreciated.<br><br>tone<br><br>
 
As Far As I Know, There is no command to export a memo field into a formated output. There are only 2 types of output from a memo file.&nbsp;&nbsp;A variable length character string or a text file. Both will require programming to extract the info. <p>David W. Grewe<br><a href=mailto:Dave@internationalbid.net>Dave@internationalbid.net</a><br><a href= > </a><br>
 
One approach, not the ideal but maybe good enough, is to only take the first 250 characters of the memo field, like this:<br><br>select myfield1, myfield2, left(mymemo,250) as mytext ;<br>from mytable<br><br>copy to mytextfile<br><br>Obviously, anything after the first 250 characters will be truncated.
 
Following the same thought as above, you could also do:<br><br>select field1, left(field2, len(field2)), field3 from table1<br>copy to mytextfile <br><br>or<br><br>select field1, left(field2, len(alltrim(field2))), field3 from table1<br>copy to mytextfile<br><br>-SK
 
The idea:<br><br>left(field2, len(field2)) is good in theory, but I think Fox will either choke or refuse to write out more than 255 characters in the COPY TO.&nbsp;&nbsp;I haven't tried it lately, but my last experience was that this was all it would do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top