【问题标题】:Inserting special characters插入特殊字符
【发布时间】:2016-11-24 02:45:39
【问题描述】:

我正在尝试在我的 Cassandra 表中插入特殊字符,但我无法插入它。 Inserting data in table with umlaut is not possible 正如链接中提到的,即使我的字符集是 UTF8,我也尝试了上面的链接。我无法插入。我试过用引号还是不行

CREATE TABLE test.calendar (
    race_id int,
    race_start_date timestamp,
    race_end_date timestamp,
    race_name text,
    PRIMARY KEY (race_id, race_start_date, race_end_date)
) WITH CLUSTERING ORDER BY (race_start_date ASC, race_end_date ASC


insert into test.calendar (race_id, race_start_date , race_end_date , race_name ) values  (501,2016-02-18 05:00:00+0000 ,2016-02-22 05:00:00+0000 ,'Hotel in der Nähe von mir');

ERROR MESSAGE :
SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] message="line 1:99 mismatched input '-02' expecting ')' (...race_name ) values  (501,2016[-02]-18...)">

【问题讨论】:

    标签: cassandra datastax cql datastax-enterprise


    【解决方案1】:

    您没有引用您的日期值,因此 2016-02-22 05:00:00+0000 被视为“2016 减去 02 减去 22 等等等等” - 一个算术运算,后跟一些随机数字垃圾。

    试试

    INSERT .... VALUES(... '2016-02-22 05:00:00+0000', ...)
                           ^------------------------^
    

    相反。注意' 引号。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-25
      • 2019-10-13
      • 2014-11-17
      • 2016-02-18
      • 1970-01-01
      • 2023-03-10
      相关资源
      最近更新 更多