Tip problem with text column on SQL Server 2008R2

General discussion forum about all databases other than SqlBase.
MSchmidt
Germany
Posts: 299
Joined: 03 Jul 2017, 09:28
Location: Germany

Tip problem with text column on SQL Server 2008R2

Post by MSchmidt » 15 Jun 2011, 15:47

TD 1.5.1
Sql Server 2008 R2
win 7 64
td app under exe.manifest

sometimes we have had problems if we made an sql-update of a multilinefield defined as LongString to a sql-server text column.

the multilinefield was detected as an image (!)

message was: "operand type clash: image is incompatibel with text" or in German:"Operandentypkollision: image is incompatibel with text"

f.e. 'update testtable set testcolumn = :ml1'

inside ml1 there was only text or nothing

but this hapens only sometimes (!)
only in some frmwindows we had the problem. The same statement in Window 1 runs without a problem, but in window 2 the failure occurs.

after we changed the sql to 'update testtable set testcolumn = \'' || ml1 || '\' '
we never had the problem again.

don't know the reason why, but maybe this workaround can help, if you have this problem, too

greetings
Michael

Harald
Germany
Posts: 150
Joined: 30 Mar 2017, 06:16
Location: Rosenheim, Germany

Re: Tip problem with text column on SQL Server 2008R2

Post by Harald » 21 Jun 2011, 21:03

Hi Michael,

do you use SqlSetLongBindDatatype? If your text column has a length greater than 253 chars you have to use them between prepare and execute command:

Code: Select all

If SqlPrepare( hSql1, 'UPDATE Payments SET Remarks = :mlRemarks WHERE RecId = :nRecId ' )
   
   Call SqlSetLongBindDatatype( 1, 23 )
   
   Call SqlExecute( hSql1 )
   
Call SqlCommit( hSql1 )

Regards
Harald

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests