【问题标题】:amazon simpledb attribute naming restrictions?amazon simpledb 属性命名限制?
【发布时间】:2012-11-23 19:29:06
【问题描述】:

我想知道amazons simpledb中的属性名称是否有任何限制。 我尝试了以下属性名称

my.attribute.name

运行以下查询

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

导致错误:“指定的查询表达式语法无效。”。 此外,围绕“my.attribute.name”会导致错误,因为选择语法无效。

将点改为下划线,一切正常:

my_attribute_name

查询运行良好

select * from mydomain where my_attribute_name is not null

现在我的问题是:属性允许使用哪些字符? 在amazon developer manual 上,名称仅限于在 xml 文档中有效的字符。这到底是什么意思?链接的 W3C 文档似乎没有回答这个问题。在域名中,点“.”是允许的。

目前我使用sdbTool。我希望这不会影响行为。

在属性名称中插入一些其他字符正在起作用,例如:'my:attribute-name.with other%20chars'。

有什么想法吗?

【问题讨论】:

    标签: sql attributes amazon-web-services amazon amazon-simpledb


    【解决方案1】:

    您能否将您的属性名称用反引号括起来,然后再试一次?

    如果域名和属性名称包含任何特殊字符,则需要用反引号括起来。如果属性和域名仅包含字母、数字、下划线 (_) 或美元符号 ($),则它们可能会出现不带引号的情况。如果所有其他属性和域名包含任何特殊字符,则必须用反引号 (`) 引用它们。

    【讨论】:

    • 谢谢,工作就像一个魅力。该信息也在 API 中,但有时很难找到。适用于 SDBTool 以及 Amazon SimpleDB Scratchpad。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-02
    • 2014-09-09
    • 1970-01-01
    • 2011-12-02
    • 2011-03-20
    • 1970-01-01
    相关资源
    最近更新 更多