SQL 관리자가 2008 년부터 2008 R2까지 MSSQL을 업그레이드했습니다. 이 업그레이드를하기 전에 FreeTDS에서 MSSQL을 사용했지만 업그레이드 후에는 저장 프로 시저의 출력 매개 변수를 읽을 수 없었습니다. 그래서 나는 리눅스 용 Microsoft Site에서 공식 ODBC 드라이버를 설치했다. (CentoOS 64를 사용하고있다.) Now : 나는 간단한 쿼리를 만들 수 있지만 저장 프로 시저의 출력 매개 변수를 잡을 수 없다. 쿼리 결과 출력 :CENTOS PHP PDO ODBC MSSQL 2008 r2
select OutputString from tTableOutput where ID = 5
여기서 OuptutString은 큰 xml을 포함합니다.
PDO, ODBC 및 모든 기능이 작동하지 않습니다. 내가 PDO를 사용하는 경우 :
$result = $db->query("select OutputString from tTableOutput with(nolock) where ID = 5");
foreach ($result as $row) {
print_r($row);
}
를 내가 얻을 :
PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[01004]: String data, right truncated: 0 [Microsoft][ODBC Driver 11 for SQL Server]String data, right truncation (SQLFetchScroll[0] at /builddir/build/BUILD/php-5.3.3/ext/pdo_odbc/odbc_stmt.c:528
)
어떻게 길이 제한을 늘릴 수 있습니까? 내가 ODBC를 사용하는 경우
:
$conn = odbc_connect($dataSource,$user,$password);
$sql = "select OutputString from tTableOutput where ID = 5";
$rs=odbc_exec($conn,$sql);
odbc_binmode ($rs, ODBC_BINMODE_PASSTHRU);
odbc_longreadlen ($rs, 0);
if (!$rs){
exit("Error in SQL");
}
while (odbc_fetch_row($rs)){
print_r(odbc_result($rs, "OutputString"));
}
odbc_close($conn);
를 내가 얻을 :
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 4294967293 bytes)
왜이 쿼리는 4GB의 메모리가 필요하십니까?
내가