Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to insert file from client side to blob via SqlPlus ?

2,140 views
Skip to first unread message

Maija-Leena

unread,
Nov 28, 2007, 8:05:51 AM11/28/07
to
Hi,
what is the simplest way of inserting a file from a client to a blob column
using SqlPlus ?

Regards,

Maija-Leena


hpuxrac

unread,
Nov 28, 2007, 1:40:44 PM11/28/07
to

You might want to do some searches on Tom Kyte's site http://asktom.oracle.com
he's got this area pretty well covered there.

Probably the free SQL Developer tool can handle this is a guess.

Most of the time people have an application coded to perform this kind
of functionality instead of sqlplus.

DA Morgan

unread,
Nov 28, 2007, 5:03:24 PM11/28/07
to

Look at the dbms_lob built-in package
http://www.psoug.org/reference/dbms_lob.html
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damo...@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org

Maxim Demenko

unread,
Nov 28, 2007, 5:19:12 PM11/28/07
to DA Morgan
DA Morgan schrieb:

> Maija-Leena wrote:
>> Hi,
>> what is the simplest way of inserting a file from a client to a blob
>> column
>> using SqlPlus ?
>>
>> Regards,
>>
>> Maija-Leena
>
> Look at the dbms_lob built-in package
> http://www.psoug.org/reference/dbms_lob.html

Don't think dbms_lob can handle files on the client.
One of possibilities on the recent oracle version which don't involve
coding in third party language could be builtin XMLDB (iirc - no
additional license cost) - file can be transferred into repository by
means of wide used protocols - webdav or ftp.

Best regards

Maxim

DA Morgan

unread,
Nov 29, 2007, 11:19:23 AM11/29/07
to

You are correct unless the client is mapped to the server which is
certainly something I wouldn't recommend. Thanks for catching that.

ErikYkema

unread,
Nov 30, 2007, 12:37:49 PM11/30/07
to

a little Q&D:
call !sqlldr from sqlplus, see e.g. http://www.orafaq.com/faqloadr.htm#LOBS
for a sample. I would not recommend this for production code that is
exposed to end-users.
A proper way would perhaps be through a browser app using a http
upload to the appserver (APEX?), but have never built such a thing.
Another option could be to put the file on the server using a shared
disk (windows share or mapped drive or samba share in case of a unix
server). Then the client calls a stored procedure that accesses the
file through a directory.
Also not too elegant in my opinion.
Perhaps Oracle Forms has some options for client side file operations.
Not sure.
Good luck, regards, Erik Ykema
Regards,
Erik

0 new messages