Search code examples
amazon-web-servicesamazon-simpledb

AWS SimpleDB CLI: How to use the 'select' command?


I'm trying to use the select command of AWS SimpleDB from AWS CLI.

The required call is as follows: select --select-expression <value>

with select-expression being described as follows: --select-expression (string) The expression used to query the domain.

The select is supposed to be similar to the SQL select statement, however I keep getting errors about the syntax, e.g.:

aws sdb select --select-expression "select * from my-domain"

An error occurred (InvalidQueryExpression) when calling the Select operation: The specified query expression syntax is not valid.

I can't find any documentation or example about the right syntax to use, either.


Solution

  • I found the solution - turns out I needed to use single quotes for the query and special character around the table name:

    aws sdb select --select-expression 'select * from `my-domain`'