首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >cassandra cql查询替换

cassandra cql查询替换
EN

Stack Overflow用户
提问于 2012-01-07 08:03:21
回答 1查看 766关注 0票数 1

举例说明:

代码语言:javascript
复制
import cql
cql connect to CF/Keyspace
last_key = XYZ (say it's getting fetched from else where)
cursor.execute(select * from domain_dimension where key=:key", key="last_key")

CQL文档说这是可以做到的,但是在控制台上它说execute()得到了意外的关键字参数。

Cassandra CQL真的支持查询替换吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-01-07 09:15:41

看起来您需要在dict中将替换作为单个arg传递,而不是作为关键字args。

代码语言:javascript
复制
cursor.execute("select * from domain_dimension where key=:key", {'key': last_key})

这就是它在项目主页上的示例中指定的方式:http://code.google.com/a/apache-extras.org/p/cassandra-dbapi2/

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8766089

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档