如何在 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
How to view blob data in Oracle SQL Developer
提问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
-
- Open data window of your table.
- The BLOB cell will be named as (BLOB).
- Right click the cell.
- You will see a pencilicon. Click on it.
- It will open a blob editorwindow.
- You would find two check boxes against the option View as : Image or Text.
- Select the appropriate check box.
- If above step is still convincing, then use the Downloadoption.
- 打开表格的数据窗口。
- BLOB 单元格将命名为(BLOB)。
- 右键单击单元格。
- 您将看到一个铅笔图标。点击它。
- 它将打开一个blob 编辑器窗口。
- 您会在View as: Image 或 Text选项旁找到两个复选框。
- 选择适当的复选框。
- 如果上述步骤仍然令人信服,请使用“下载”选项。
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, SPOOL
the result to an HTML
file, 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 文件用我的浏览器打开,看截图 -