If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > How to insert \n into TEXT column

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-08-06, 16:48
dleewo dleewo is offline
Registered User
 
Join Date: Jun 2006
Posts: 3
How to insert \n into TEXT column

I have a text column thatI want to preload with some text that contains EOLN (\n) charcters.

I know I need to use "LOAD" to load the text column, but regardless of what I try, I can't get the \n character loaded. I even insert it programatically and then used "UNLOAD" to generate a file, but that same file fails to put back the \n character when used with the LOAD command.

UNLOAD generates a file like:

f1!f2!line1\
line2\
line3!f4

I also tried

f1!f2!line1\nline2\nline3!f4

Does anyone know how I can do this?
Reply With Quote
  #2 (permalink)  
Old 06-08-06, 16:54
artemka artemka is offline
Registered User
 
Join Date: May 2004
Location: New York
Posts: 248
you can try inserting records and then use an update statment
something like

update tablename set column[5,6] = "\n"
where statment

Don't know if that is an option for you
Reply With Quote
  #3 (permalink)  
Old 06-08-06, 18:20
dleewo dleewo is offline
Registered User
 
Join Date: Jun 2006
Posts: 3
That's certainly an option if it'll work. I'll give it a shot in the morning.

Thanks
Derek
Reply With Quote
  #4 (permalink)  
Old 06-09-06, 09:51
dleewo dleewo is offline
Registered User
 
Join Date: Jun 2006
Posts: 3
I gave this a shot, but Informix gives me the error:

"A blob subscript is not allowed within this context"

I guess it can't be used for updating rows. I played around with the subscripts and it does work for SELECTs.

Some Google searching found:

616 A TEXT or BYTE subscript is not allowed within this context.

This UPDATE or INSERT statement specifies a subscripted column of BYTE or TEXT data type as a destination. Subscript notation is not allowed in this context; a BYTE or TEXT (or any other) value must be replaced in full. Revise the statement to assign into whole columns.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On