Converting Memo fields back to Text fields 
Author Message
 Converting Memo fields back to Text fields

Hi

I am trying to convert some fields in my table which are MEMo fields but
having them as text fields as smarter and faster because they satisfy the
character type specifications.  However, if I do change my field type
through the database designer, I loose all the information contained
within the memo fields.  Is there a way to prevent this happening ?

Thanks, Kemal

--
____________________________________________________________
         M U S T A F A    K E M A L    C A K I C I      
            THE GEORGE WASHINGTON UNIVERSITY            
        School of Engineering and Applied Sciences      
         Civil & Mechanical Engineering Department
                -----------0-----------                  


            http://www.*-*-*.com/ ~cakici            
------------------------------------------------------------



Mon, 19 Jul 1999 03:00:00 GMT  
 Converting Memo fields back to Text fields

You need to create new character fields to contain the contents of the
current memo fields BEFORE changing/removing the old memo fields.

If you have memo1,memo2 and memo3 you will need to create additional
fields called (for example) target1,target2 and target3.

Then issue a :-

        REPLACE target1 with memo1, ;
                target2 with memo2, ;
                target3 with memo3

Once you are happy that the new target fields contain the correct data
- modify the structure again and remove the (now redundant) memo
fields.

If you then want your target fields to have the same names as the
original memo fields (so your existing code still works) modify the
structure again (don't combine it with removing the memo fields, it
won't work correctly) and change the name of the fields as
appropriate.

HTH

Regards

David Smith


Quote:
>Hi

>I am trying to convert some fields in my table which are MEMo fields but
>having them as text fields as smarter and faster because they satisfy the
>character type specifications.  However, if I do change my field type
>through the database designer, I loose all the information contained
>within the memo fields.  Is there a way to prevent this happening ?

>Thanks, Kemal

>--
>____________________________________________________________
>         M U S T A F A    K E M A L    C A K I C I      
>            THE GEORGE WASHINGTON UNIVERSITY            
>        School of Engineering and Applied Sciences      
>         Civil & Mechanical Engineering Department
>                -----------0-----------                  


>           http://gwis2.circ.gwu.edu/~cakici            
>------------------------------------------------------------



Mon, 19 Jul 1999 03:00:00 GMT  
 Converting Memo fields back to Text fields

Quote:

> You need to create new character fields to contain the contents of the
> current memo fields BEFORE changing/removing the old memo fields.

>> snip <<

Don't forget the 255 size limit on a character field.  If any of your memo
fields contain maore than this many characters you will either have to divide
them among multiple character fields or lose data.

David Schwartz
Lockheed Martin GES
Moorestown, New Jersey



Mon, 19 Jul 1999 03:00:00 GMT  
 Converting Memo fields back to Text fields

Quote:
>   I am trying to convert some fields in my table which are MEMo fields but
>   having them as text fields as smarter and faster because they satisfy the
>   character type specifications.  However, if I do change my field type
>   through the database designer, I loose all the information contained
>   within the memo fields.  Is there a way to prevent this happening ?

Hi!
Try to define additional character field TEXT and then do:
REPLACE ALL text WITH ALLTRIM(<your_memo>) and then delete memo from
your table.

Good luck,



Fri, 23 Jul 1999 03:00:00 GMT  
 Converting Memo fields back to Text fields


[ Coutesy cc:'ed to quoted author through e-mail ]

Quote:
>Hi
>I am trying to convert some fields in my table which are MEMo fields but
>having them as text fields as smarter and faster because they satisfy the
>character type specifications.  However, if I do change my field type
>through the database designer, I loose all the information contained
>within the memo fields.  Is there a way to prevent this happening ?

If these fields satisfy character-type specs, do a conversion with
SQL-SELECT:

SET MEMOWIDTH TO 254
SELECT <list of other fields>,;
   MLINE(<your memo field>,1) as <new text field> ;
   FROM <your file> ;
   INTO TABLE <new file>

After that you can delete <your file>.DBF, <your file>.FPT and <your
file>.CDX, rename <new file>.DBF to <your file>.DBF, and re-create
indices.

[fix reply-to address before replying - I'm sick and tired of junk e-mail]
Alexandre Pechtchanski, GCRC system manager Mt.Sinai School of Medicine, NY



Fri, 23 Jul 1999 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Convert memo field in character field

2. Converting FOX Memo Field to Oracle CLOB field using SQL

3. Error Updating SQL7 TEXT field from MEMO field

4. Converting Memos/Memo fields

5. Convert FoxPlus (UNIX) memo fields to DOS format

6. converting memo field to character in SQL

7. need to convert a fpw 2.6 dbf with memo fields to Access '95

8. VFP to DB2 - Converting Memo Fields

9. Converting VFP memo fields to SQL Server

10. How to convert Currency Field to Numberic Field?

11. Problem for converting DateTime field to Date Field

12. Text w/Hd Retns to Memo Fields

 

 
Powered by phpBB® Forum Software