sqlamazon-web-servicesattributesamazon-simpledb

amazon simpledb attribute naming restrictions?


I want to know if there are any restriction to attribute names in amazons simpledb. I tried the following attribute name

my.attribute.name

Running the following query

select * from mydomain where my.attribute.name is not null

results in an error: "The specified query expression syntax is not valid.". Also surrounding 'my.attribute.name' results in an error because is invalid select syntax.

Changing point to underscore and everything works fine:

my_attribute_name

and the query runs fine

select * from mydomain where my_attribute_name is not null

Now my question: What are the allowed characters for attributes? On the amazon developer manual the names are restricted to characters that are valid in xml documents. What exactly does this mean? The linked W3C documents seems not answering this. In domain names the dot "." is allowed.

Currently I use the sdbTool. I hope this doesnt affect the behaviour.

Inserting some other characters in attribute names is working, like this one: 'my:attribute-name.with other%20chars'.

Any ideas?


Solution

  • Can you please enclosed your attribute name in back-tick quotes and try again ?

    Domain names & Attribute names need to be enclosed in back-tick quotes if they contains any special characters. Attribute and domain names may appear without quotes if they contain only letters, numbers, underscores (_), or dollar symbols ($). You must quote all other attribute and domain names with the back-tick (`) if they contains any special characters.