Select returns the error DBD: ODBC: stfetchrow_arrayreffailed: st_fetchSQLFetch (SQL-HY000) with $ dbh_mssql-{LongTruncOk} 1; which can be addressed. However, this method truncates characters.
Select returns the error DBD: ODBC: st fetchrow_arrayref failed: st_fetch/SQLFetch (long truncated DBI attribute LongTruncOk not set and/or LongReadLentoo small) (SQL-HY000) in this case, $ dbh_mssql-{LongTruncOk} = 1; can be used. However, this method truncates characters.
Select Error
DBD: ODBC: st fetchrow_arrayref failed: st_fetch/SQLFetch (long truncated DBI attribute LongTruncOk not set and/or LongReadLen too small) (SQL-HY000)
In this case
$ Dbh_mssql-> {LongTruncOk} = 1;
Yes.
However, this method will
TruncationString.
I don't want
TruncationString to be complete
Read. After reading the documents, we can set the length of Long.
Use:
$ Dbh_mssql-> {LongReadLen} = 512*1024;
It is invalid when used separately.
The same error is reported.
$ Dbh_mssql-> {LongReadLen} = 512*1024;
$ Dbh_mssql-> {LongTruncOk} = 0;
Error
But it is not used together with $ dbh_mssql-> {LongTruncOk} = 1;
ProblemBut still yes
Truncation.
Or is the len Length not enough here? 2048*2048 still does not work
Result andDataType.
$ SQL _select = "select top 5 [name], [address], [developer], CAST ([othercondition] as TEXT), [projectsquare], [usinglandarea] from new_baseinfo ";
Pay attention to the red part.
It also involvesDataTypeProblem. BindTruncationTo text.
Then set.
My $ dbh_mssql = DBI-> connect ("dbi: ODBC: $ source_name", $ source_user_name, $ source_user_psd );
$ Dbh_mssql-> {LongTruncOk} = 1;
$ Dbh_mssql-> {LongReadLen} = 1048576*1024;
Print "LongReadLen: $ dbh_mssql-> {LongReadLen} \ n ";
You can.
References:
Http://blog.csdn.net/aylazhang/article/details/1707745
Http://www.freetds.org/userguide/troubleshooting.htm