如何在 Oracle SQL Developer 中查看 blob 数据

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28449798/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 03:16:45  来源:igfitidea点击:

How to view blob data in Oracle SQL Developer

sqloracle11goracle10gbloboracle-sqldeveloper

提问by bharat

How can I read blob data in Oracle SQL Developer. It is stored in byte[] format. Is there any possibility to read in string format.

如何在 Oracle SQL Developer 中读取 blob 数据。它以 byte[] 格式存储。是否有可能以字符串格式读取。

回答by Lalit Kumar B

Follow these steps in Oracle SQL Developer-

请按照以下步骤操作Oracle SQL Developer-

  1. Open data window of your table.
  2. The BLOB cell will be named as (BLOB).
  3. Right click the cell.
  4. You will see a pencilicon. Click on it.
  5. It will open a blob editorwindow.
  6. You would find two check boxes against the option View as : Image or Text.
  7. Select the appropriate check box.
  8. If above step is still convincing, then use the Downloadoption.
  1. 打开表格的数据窗口。
  2. BLOB 单元格将命名为(BLOB)
  3. 右键单击单元格。
  4. 您将看到一个铅笔图标。点击它。
  5. 它将打开一个blob 编辑器窗口。
  6. 您会在View as: Image 或 Text选项找到两个复选框。
  7. 选择适当的复选框。
  8. 如果上述步骤仍然令人信服,请使用“下载”选项。

Update

更新

OP says "text is not understandable manner it is showing ?? ?? like this"

OP 说“文本显示的方式无法理解????像这样

Probably, the locale-specific NLS charactersetdoesn't support those characters. It might also be that those are Multi-Bytecharacters. I would suggest, SPOOLthe result to an HTMLfile, open it with your browser, you could view the content as most of the browsers are capable of displaying multiple charactersets.

可能,特定语言环境的 NLS 字符集不支持这些字符。也可能是这些是多字节字符。我建议,SPOOL结果到一个HTML文件,用你的 . 打开它browser,你可以查看内容,因为大多数浏览器都能够显示多个字符集。

You could do something like this from SQL*Plus -

你可以从 SQL*Plus 做这样的事情 -

SET MARKUP HTML ON SPOOL ON
SPOOL report.html
select substr(clob_column, 1, 32767) from table_name...
SPOOL OFF

Update 2

更新 2

Regarding SPOOL as HTML, test case -

将 SPOOL 视为 HTML,测试用例 -

SET MARKUP HTML ON SPOOL ON
SPOOL D:\report.html
SELECT substr(ename, 1, 5) ename FROM emp where rownum <=5;
SPOOL OFF

Works perfectly for me, html file opens up with my browser, look at the screenshot -

非常适合我,html 文件用我的浏览器打开,看截图 -

enter image description here

在此处输入图片说明