Inserting a hard-coded UUID via CQLsh (Cassandra)

冷暖自知 提交于 2019-11-29 05:24:00

You shouldn't put the quotes around the UUID to stop it being interpreted as a string i.e.

insert into devices (device_id, geohash,name, external_identifier, measures, tags) 
 values 
(c37d661d-7e61-49ea-96a5-68c34e83db3a,'9q9p3yyrn1', 'Acme1', '936', {'aparPower','actPower','actEnergy'},{'make':'Acme'});

Alternate: Use uuid() function. i have tested this in DevCenter 1.6.0.

insert into CHANGE_LOG (someid, modifieddatetime, snum, gnum, source) values ( uuid() , '2000-12-12 08:00:00', '21A', '', 'system');

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