doq8211 2013-11-03 15:01
浏览 29
已采纳

PHP Azure表存储过滤器对除分区键以外的列进行过滤

I am using the PHP Azure table storage REST API and its giving me unique error when i use any other column other than partition key to filter the dataset

If i use the following Filter condition it works fine.

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

If i add any other column other than Parition key it gives error. e.g when i use below filter it generate error

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

it says Call to a member function getEntities() on a non-object .

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();

I am using logic as provided on Tutorial http://www.windowsazure.com/en-us/develop/php/how-to-guides/table-service/

  • 写回答

1条回答 默认 最新

  • dtm37893 2013-11-03 15:14
    关注

    I think there's an error in your query syntax itself. Try changing your query from:

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

    to

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

    Do take a look here for supported comparison operators: http://msdn.microsoft.com/en-us/library/windowsazure/dd894031.aspx.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 vue router 动态路由问题
  • ¥15 关于#.net#的问题:End Function
  • ¥15 无法import pycausal
  • ¥15 VS2022创建MVC framework提示:预安装的程序包具有对缺少的注册表值的引用
  • ¥15 weditor无法连接模拟器Local server not started, start with?
  • ¥20 6-3 String类定义
  • ¥15 嵌入式--定时器使用
  • ¥20 51单片机学习中的问题
  • ¥30 Windows Server 2016利用兩張網卡處理兩個不同網絡
  • ¥15 Python中knn问题