Copying data from a TEXT field into two Varchar fields 
Author Message
 Copying data from a TEXT field into two Varchar fields
Hi,

I'm having difficulty in finding out how to copy data from a TEXT field,
which would contain no more than 400 chars, into two Varchar fields of 200.
If anyone has any ideas on how to do this, I would greatly appreciate any
help.

Thanks
Terence



Fri, 16 Mar 2001 03:00:00 GMT
 Copying data from a TEXT field into two Varchar fields

X-no-spam: yes
X-no-archive: yes

TG,

Copy your blob to another blob (e.g. in temporary table)
Then you can copy first n characters (n<=255) to varchar variable
- simply converting the text to varchar. To get characters after 255th
character, shift your blob left - see updatetext for more information
and then again convert to varchar and copy.

Hope this helps.

Quote:
>Hi,

>I'm having difficulty in finding out how to copy data from a TEXT field,
>which would contain no more than 400 chars, into two Varchar fields of 200.
>If anyone has any ideas on how to do this, I would greatly appreciate any
>help.

>Thanks
>Terence



Fri, 16 Mar 2001 03:00:00 GMT
 Copying data from a TEXT field into two Varchar fields
convert(varchar(255), text_col) will retrieve the first 255 characters. Then
delete these (with updatetext) and get the next 255 the same way. (You'll
probably want to copy the text data to a temp table before yuo do this).

    Christer Romson

Terence:

Quote:
>I'm having difficulty in finding out how to copy data from a TEXT field,
>which would contain no more than 400 chars, into two Varchar fields of 200.
>If anyone has any ideas on how to do this, I would greatly appreciate any
>help.



Fri, 16 Mar 2001 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Using a text field to combine multiple varchar(255) fields

2. SQL 6.5 - text field to varchar(255) fields

3. Appending varchar fields to a text field in a temporary table

4. DTS Transfer Object fails to copy VarChar(4096) field data

5. Adding VARCHAR Data To A TEXT Field

6. Truncate data from text and varchar datatype fields

7. Transferring LARGE data from TEXT to varchar fields

8. Trasfer data from One field to Two Fields

9. Copy data from string field to memo field

10. copying data from clob field into long field

11. copy data from clob field into long field

12. copying field data to another field


 
Powered by phpBB® Forum Software