Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > Oracle
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 26th, 2005, 02:18 AM
Authorized User
 
Join Date: Sep 2004
Location: Muscat, , Oman.
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

  #2 (permalink)  
Old December 15th, 2005, 01:22 PM
Registered User
 
Join Date: Sep 2005
Location: , , .
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

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:23 PM.


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