Multiline textfield - Problems with CRLF

Discussion forum about all things SqlBase or SqlTalk
vikingbees

Multiline textfield - Problems with CRLF

Post by vikingbees » 08 Feb 2011, 20:11

Hello all.

Perhaps I havent enough experience of TD (started 18 years ago)

When I type in a multiline textfield I do like this

=====
Text here and more here


More text here after two blank lines


And more here after another two blank lines
=====


After the text is stored in SqlServer and I retrieve it it looks like this;

=====
Text here and more here More text here after two blank lines And more here after another two blank lines
=====


When I used TD2.1 it worked, but now in TD6 Im struggling.

Hope to get some help from a Guru

Jeff Luther

Re: Multiline textfield - Problems with CRLF

Post by Jeff Luther » 09 Feb 2011, 01:18

What DB brand? What DB column data type are you storing the ML text into? A small test case with SQL create statement + small test case can help you figure this out, and help us help you if necessary.

vikingbees

Re: Multiline textfield - Problems with CRLF

Post by vikingbees » 10 Feb 2011, 17:28

Hello

Im using SqlServer2000 and SqlServer2008 and a varchar(3000) column

vikingbees

Re: Multiline textfield - Problems with CRLF

Post by vikingbees » 16 Sep 2011, 09:04

Here is the case

Internal variable sLong = longstring

The DB column is varchar(3000)

Moving the multiline field value to sLong

sLong = 'Lavender Broline är favorit och det köper jag utan prut.(CRLF)
Hon har en trist rad, med tidiga galopper bakom bilen i de senaste två starterna.(CRLF)
Men Lennartsson ska testa henne bakom bilen inför tävlingarna och kommer att köra extremt.(CRLF)
(CRLF)
Jag väljer att ställning för henne på ett av systemen och hoppas att många spelare skräms av raden och garderar.(CRLF)'


Set sUpdate = 'update brevmall set brevtext = ' || '\'' || sLong || '\'' || ' where mallid = ' || sMallID
If SqlPrepareAndExecute( hSql4, sUpdate )

Nils Jänicke
Germany
Posts: 423
Joined: 20 Sep 2017, 11:56
Location: Villingen-Schwenningen, Germany

Re: Multiline textfield - Problems with CRLF

Post by Nils Jänicke » 19 Sep 2011, 08:57

I think you should use bind variables:

Long String: sLong
...
Set sUpdate = 'update brevmall set brevtext = :sLong where mallid = :sMallID'

Return to “SqlBase General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests