0

私は pdo で php を使用しpdo_dblib、長い選択クエリを実行します (この場合)。このクエリをSQLで直接実行すると結果が返されますが、phpから実行すると結果が返されます

207 General SQL Server error: Check messages from the SQL Server [207] (severity 16) [(null)]

準備後debugDumpParamsにクエリを確認していましたが、クエリから最初の 500 文字しかダンプされず、これが問題である可能性があります。これは何らかの構成パラメーターですか、それともバグですか?

OS: Slackware PHP: 5.4.7 pdo_dblib - 自分でコンパイル freetds - http://slackbuilds.org/から

PDO::debugDumpParams の出力に上限はありますか?

編集:

コード:

<?php
$dsn = 'dblib:host=XXXXXXXX;dbname=XXXXX';
$username='XXXXX';
$password='XXXXXXX';


$query = "select * from (
                select Row_Number() over (order by 
                order_status.id desc) as RowIndex,  
                order_status.id as ID,
                order_status.caller_type_id as CALLER_TYPE_ID,
                order_status.phone as PHONE,
                order_status.order_number as ORDER_NUMBER,
                order_status.caller_client_data_id as CLIENT_DATA_ID,
                order_status.caller_contact_phone_id as CALLER_CONTACT_PHONE_ID,
                order_status.record_date as DATE,
                order_status.call_date as CALL_DATE,
                order_status.call_time as jueCALL_TIME,
                order_status.username as USERNAME,
                client_data.ID as CALLER_ID,
                client_data.client_type_id as CLIENT_TYPE_ID,
                client_data.name as NAME,
                client_data.person as PERSON,
                client_data.country_id as COUNTRY_ID,
                client_data.city as CITY,
                client_data.street as STREET,
                client_data.street_number as STREET_NUMBER,
                client_data.living_complex as LIVING_COMPLEX,
                client_data.building as BUILDING,
                client_data.entrance as ENTRANCE,
                client_data.floor as FLOOR,
                client_data.apartment as APARTMENT,
                client_data.postal_code as POSTAL_CODE,
                client_data.description as DESCRIPTION,
                client_data.email as EMAIL,
                country.name as COUNTRY,
                client_type.type as CLIENT_TYPE,
                caller_type.name as CALLER_TYPE,
                contact_phone.phone as CALLER_CONTACT_PHONE
                from order_status order_status
                inner join client_data client_data on client_data.id = order_status.caller_client_data_id
                inner join client_type client_type on client_type.id = client_data.client_type_id
                inner join country country on country.id = client_data.country_id
                inner join caller_type caller_type on caller_type.id = order_status.caller_type_id
                inner join contact_phone on contact_phone.id = order_status.caller_contact_phone_id
             where 1=1 ) as Sub Where Sub.RowIndex >= ? and Sub.RowIndex < ?";


$db = new PDO($dsn, $username, $password);
$prepare = $db->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
$bind = array(1, 11);
if (!$prepare->execute($bind)) {
    $prepare->debugDumpParams();
} else {
    echo "success";
}

出力:

SQL: [1841] select * from (
                select Row_Number() over (order by 
                order_status.id desc) as RowIndex,  
                order_status.id as ID,
                order_status.caller_type_id as CALLER_TYPE_ID,
                order_status.phone as PHONE,
                order_status.order_number as ORDER_NUMBER,
                order_status.caller_client_data_id as CLIENT_DATA_ID,
                order_status.caller_contact_phone_id as CALLER_CONTACT_PHONE_ID,
                order_status.record_date as DATE,
                order_status.call_date as CALL_DATE,
                order_status.call_time as jueCALL_T
Params:  2
Key: Position #0:
paramno=0
name=[0] ""
is_param=1
param_type=2
Key: Position #1:
paramno=1
name=[0] ""
is_param=1
param_type=2
4

2 に答える 2

0

PDO プロセスのサーバーで TDSDUMP 環境変数を設定します。ログには、不足しているメッセージと必要な詳細が記録されます。

于 2013-01-16T06:17:06.373 に答える
0

お時間をいただき申し訳ございません。エラーが見つかりました - MSSQL で 2 つの異なるデータベースに接続します。

freetds 構成でダンプ ファイルを有効にすると、 PSSegmentation faultエラーが引き続き表示さdebugDumpParamsれますが、500 文字を超える出力を設定する方法がわかりませんPDO::debugDumpParams の出力に上限はありますか?

于 2013-01-16T08:31:45.177 に答える