帮助中心

# execute-execute

调用execute函数执行数据库语言。

最小支持版本:6.5.0

# 接口说明

已获取数据库连接器,详情请参见createConnector (opens new window)
已连接SQLite数据库,详情请参见connect (opens new window)
已获取获取SQLite游标对象,详情请参见getCursor (opens new window)

# 语法

<SQLiteCursor object>.execute(<sql>, <params>)
1
<SQLiteCursor object>.execute(<sql>, <params>)
1

# 函数类型

实例函数

# 请求参数

参数名称 类型 是否必选 默认值 示例值 描述
sql Cube.Lang.String "select * from test_table where id=? and age=?" 数据库语言。
params Cube.Lang.List [3, 18] 数据库语言参数。规则如下:
params参数列表中的每个元素依次对应sql参数中的一个“?”。

# 返回参数

参数名称 类型 示例值 描述
Result Cube.Lang.Null Cube.Lang.Null 该函数返回值为空值。

# 请求示例

SQLiteCursor对象.execute("select * from test_table where id=%s and age=%s", [3, 18])
1
最近更新时间: { "value": "2023-09-12", "effect": true }