You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

OML Notebook中Oracle数据库表多列与全列查询语法咨询

OML Notebook中读取Oracle表多列的正确语法

读取指定多列的两种正确写法

  1. 使用双层方括号传递列名列表
test_sentences = oml.sync(table="CONFILE_1000")[["TEXT", "ID"]].pull()
  1. 使用select()方法明确指定列
test_sentences = oml.sync(table="CONFILE_1000").select("TEXT", "ID").pull()

读取所有列的写法

如果需要读取表中全部列,直接调用pull()即可,无需指定列:

test_sentences = oml.sync(table="CONFILE_1000").pull()

也可以用select("*")显式声明读取所有列:

test_sentences = oml.sync(table="CONFILE_1000").select("*").pull()

原写法失败原因

你之前的["TEXT","ID"]是元组格式,而oml.DataFrame的索引只接受单个列名字符串,或者用双层方括号包裹的列名列表。元组无法被正确解析,导致执行失败。

内容的提问来源于stack exchange,提问作者Sachin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.19 12:58:10