Inserting special characters

丶灬走出姿态 提交于 2019-12-11 01:35:11

问题


I'm trying to insert special characters in my Cassandra table but I couldn't insert it. Inserting data in table with umlaut is not possible As mentioned in the link i tried above link even though my character set is UTF8 as mentioned.I'm not able to insert. I've tried using quotes also still didn't work

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...)">

回答1:


You didn't quote your date values, so 2016-02-22 05:00:00+0000 is seen as "2016 minus 02 minus 22 blah blah blah" - an arithmetic operation followed by some random numerical garbage.

Try

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

instead. Note the ' quotes.



来源:https://stackoverflow.com/questions/38488457/inserting-special-characters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!