插入特殊字符 [英] Inserting special characters

查看:166
本文介绍了插入特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Cassandra表中插入特殊字符,但我无法插入。
无法使用umlaut在表中插入数据
如上所述我尝试上面的链接,即使我的字符集是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: SyntaxException:< ErrorMessage code = 2000 [CQL查询中的语法错误] message =line 1:00 + 0000,'Hotel in derNähevon mir');

错误消息:
99不匹配输入'-02'expecting')'(... race_name)values(501,2016 [-02] -18 ...)>


解决方案

您没有列出日期值, code> 2016-02-22 05:00:00 + 0000 被视为2016减02减22 blah blah blah - 算术运算后面跟随一些随机数字垃圾。 p>

尝试

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

。请注意'引号。


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

解决方案

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.

这篇关于插入特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆