使用 INSERT 语句将 PDF 文件保存到 BLOB 列 Oracle DB

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21434403/
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-19 02:12:40  来源:igfitidea点击:

Save PDF-File into BLOB-Column Oracle DB with INSERT statement

sqldatabaseoracleblob

提问by Christian

I have to save a PDF-File into a BLOB-Column from a Oracle DB. I can't use Java and have to use an INSERT-Statement.

我必须从 Oracle DB 将 PDF 文件保存到 BLOB 列中。我不能使用 Java,必须使用 INSERT 语句。

The only solutions I've found while searching were very complex.

我在搜索时发现的唯一解决方案非常复杂。

Is there an easy solution like: INSERT INTO (BLOB_COLUMN) VALUES(BLOBPDF("myPDF.pdf")or something like that?

是否有一个简单的解决方案,例如:INSERT INTO (BLOB_COLUMN) VALUES(BLOBPDF("myPDF.pdf")或类似的东西?

回答by Egalitarian

I would suggest that you use a stored procedure in Oracle where you pass the path to your PDF file and calling the stored procedure does the insert.

我建议您在 Oracle 中使用存储过程,在其中传递 PDF 文件的路径并调用存储过程进行插入。

Look at the last two sample example here.

此处查看最后两个示例示例。

回答by bdn02

If the load is "one-shot" you can use SQLDeveloper. Otherwise you can use sqlloader (http://docs.oracle.com/cd/B19306_01/server.102/b14215/ldr_params.htm) that is designed for this type of operations

如果负载是“一次性”,您可以使用 SQLDeveloper。否则,您可以使用专为此类操作设计的sqlloader ( http://docs.oracle.com/cd/B19306_01/server.102/b14215/ldr_params.htm)