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.

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

报告相同问题?

悬赏问题

  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛