Question

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/

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top