mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-11 19:29:35 +02:00
odbc: bind string parameters as SQL_WLONGVARCHAR only for more than 2000 characters
(cherry picked from commit f57adee862
)
This commit is contained in:
parent
5874dc3cca
commit
6236a5f558
@ -505,10 +505,11 @@ begin
|
||||
ColumnSize:=Size; //The defined or maximum column size in characters of the column or parameter
|
||||
BufferLength:=Size;
|
||||
CType:=SQL_C_WCHAR;
|
||||
case AParams[ParamIndex].DataType of
|
||||
ftFixedChar, ftFixedWideChar: SqlType:=SQL_WVARCHAR;
|
||||
else SqlType:=SQL_WLONGVARCHAR;
|
||||
end;
|
||||
if (AParams[ParamIndex].DataType in [ftMemo, ftWideMemo])
|
||||
or (Length(WideStrVal)>2000) then // long texts (more than 2000 unicode characters) must be bound as SQL_WLONGVARCHAR
|
||||
SqlType:=SQL_WLONGVARCHAR
|
||||
else
|
||||
SqlType:=SQL_WVARCHAR;
|
||||
end;
|
||||
ftSingle:
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user