选择 * 返回 CLOB
我以前没有使用过oracle,我要修改clob数据,因为它有我的家庭电话号码。 但是当我执行 select * from
表显示 CLOB
时,我看不到数据。 如何查看数据以及如何更新?
我需要查询。
I have not used oracle before and I was to modify the clob data as it has my home phone number. But when I do select * from
table shows CLOB
and I cannot see the data. How can I see the data and how to I Update?
I need the query.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
在
PL/SQL Developer
中,选择ROWID
以及表列:这将允许您编辑表的数据。
然后只需检查
CLOB
字段附近的...
按钮并对其进行编辑。您可以从文件加载它或只需在编辑字段中键入。
In
PL/SQL Developer
, selectROWID
along with table columns:This will allow you to edit the table's data.
Then just check a
...
button near theCLOB
field and edit it.You can load it from file or just type into the edit field.
您使用什么工具来执行查询? sqlplus 会将 clob 列中的 select 截断为参数 long 的值。 如果您使用 sqlplus,则将 long 设置为足够大的值以容纳 clob,然后执行简单的选择应该返回数据。 Clob 只是文本,因此可以像表中的任何其他列一样进行查询。 如果您使用 sqlplus 并且它不返回任何内容而不是部分返回,那么请确保表中的列已填充。
What tool are you using to perform the query? sqlplus will truncate select from a clob column to the value of the parameter long. If you are using sqlplus then set long to a large enough value to hold the clob and then doing a simple select should return data. Clobs are just text so it can be query as any other column in a table. If you are using sqlplus and it returns nothing instead of partial, then make sure the column in the table is populated.
在代码中?
Java(更新作为 dbo 对象中的字段保存的 CLOB 字段):
其中 writeClob() 是:
有时我想知道为什么该死的 Oracle 驱动程序本身无法检测到字段是 CLOB 并且只是透明地处理 ps。 setString("非常长的值"); 本身...有人回复说“为什么不使用 Oracle LOB Java 实用程序方法?!” 我从来不知道...
In code?
Java (updating a CLOB field held as a field in an object called dbo):
where writeClob() is:
and sometimes I wonder why the darned Oracle driver itself can't detect that a field is a CLOB and just transparently cope with ps.setString("very long value"); itself... and this is where someone replies saying "why not use Oracle LOB Java utility methods?!" that I never knew about...
您使用的是旧版本的 sqlplus 吗?
如果您使用的是sql Developer,只需将网格的列加宽即可。
Are you using an old version of sqlplus?
If you are using sql developer, just make the column of the grid wider.
我正在使用 dbVisualizer,并进行了定期更新并且它有效。 感谢 MichaelN 告知 Clob 只是文本,因此可以像表中的任何其他列一样进行查询。 这帮助我在几分钟内解决了我的问题。
I am using dbVisualizer and I did a regular update and it worked. Thanks MichaelN for informing that Clobs are just text so it can be query as any other column in a table. This helped me fix my issue in few minutes.
我针对您的情况提出我的方法:这是 pl/sql 中的示例。 您可以创建一个从 clob 读取的过程。
I present my approach for you situation: This is an example in pl/sql. You can create a procedure for read from clob.
在 SQL Developer 中,“打开”表。 选择“数据”选项卡(这将检索所有数据)。 然后在过滤器栏(顶部)中,提供获取要更新的单行的条件。 更新所需的列,然后提交更改。
In SQL developer, "Open" table. Select the "Data" tab (this will retrieve all data). Then in the Filter bar (top side), provide your criteria to get to the single row that you want to update. Update the required column(s) and then Commit the changes.