Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
|
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 26th, 2005, 02:18 AM
Authorized User
 
Join Date: Sep 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Copy data from a databse field to a folder

Hi:

I have a Blob type field in an oracle 9i databse which stores employee pictures. Is there a way to create a job that copies these pictures into a folder?

name of field: emp_pic
name of db: employees
path of folder to copy to: G:\employee\pic

please help.

Thanks

 
Old December 15th, 2005, 01:22 PM
Registered User
 
Join Date: Sep 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Here is a proc to put a clob in a file, try it with blob.

create or REPLACE procedure clob_to_file( p_dir in varchar2,p_file in varchar2,p_clob in clob )
as
l_output utl_file.file_type;
l_amt number default 32000;
l_offset number default 1;
l_length number default nvl(dbms_lob.getlength(p_clob),0);
 BEGIN
 l_output := utl_file.fopen(p_dir, p_file, 'w', 32760);
 while ( l_offset < l_length ) loop
   utl_file.put(l_output,
   dbms_lob.substr(p_clob,l_amt,l_offset) );
   utl_file.fflush(l_output);
   l_offset := l_offset + l_amt;
 end loop;
 utl_file.new_line(l_output);
 utl_file.fclose(l_output);
end;
/

You need a directory to xecute this proc.

Thanks to T. Kyte for the proc http://asktom.oracle.com/

By






Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy A folder to another location saidan C# 2005 18 November 10th, 2007 06:08 AM
help...copy files from sharepoint to local folder pinkflakes .NET Web Services 0 November 3rd, 2007 10:02 PM
copy file or folder to remote machine using nant kalpana2009 NAnt 1 October 9th, 2007 09:27 AM
Copy previous field record if next field is null ecampos Access VBA 6 June 23rd, 2006 12:55 PM
Giving access to asp.net to copy folder Baby_programmer ASP.NET 1.0 and 1.1 Basics 1 October 9th, 2004 03:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.