2013-11-03 48 views
0

我使用PHP Azure的表存儲REST API和它給我唯一的錯誤,當我使用其他任何其他列不是分區鍵來過濾數據集上比分區鍵其他列PHP Azure的表存儲過濾器來過濾

如果我使用以下過濾條件,它工作正常。

((PartitionKey ge '2013110100') and (PartitionKey le '2013110223')) 

如果我添加除Parition鍵以外的任何其他列,它會給出錯誤。例如當我使用下面的過濾器它會產生錯誤

((PartitionKey ge '2013110100') and (PartitionKey le '2013110223') and (cid <> '11081')) 

它說調用成員函數getEntities()在一個非對象。

try { 
     $result = $tableRestProxy->queryEntities("mytable", $filter); 
    } 
    catch(ServiceException $e){ 
     // Handle exception based on error codes and messages. 
     // Error codes and messages are here: 
     // http://msdn.microsoft.com/en-us/library/windowsazure/dd179438.aspx 
     $code = $e->getCode(); 
     $error_message = $e->getMessage(); 
     echo $code.": ".$error_message."<br />"; 
    } 

    $entities = $result->getEntities(); 

我使用邏輯提供教程http://www.windowsazure.com/en-us/develop/php/how-to-guides/table-service/

回答

1

我覺得在你的查詢語法本身就是一個錯誤。嘗試從改變你的查詢:

((PartitionKey ge '2013110100') and (PartitionKey le '2013110223') and (cid <> '11081')) 

((PartitionKey ge '2013110100') and (PartitionKey le '2013110223') and (cid ne '11081')) 

在這裏做看看支持的比較操作:http://msdn.microsoft.com/en-us/library/windowsazure/dd894031.aspx