http://eclipsesql.sourceforge.net/
Select SQL Exporter, Click Next, Click Finish.
File -> New -> other , SQL Development -> SQL File,
Enter file name, create database (any) connection throuh wizard and
click finish.
Analyst Programmer - OCE JWCD 6. OCP JAVA SE 6. OCP in 10g DBA. SQL Expert
This is a blog of programming, database administration and
problem analysis. This blog is for sharing knowledge to help me. I like to analysis and play with code and I've intention to solve any kind Java, Struts 2, Java EE, JSF 2, Enterprise Java Bean, Spring, Web Service, GlassFish, Weblogic, JBOSS and Advanced PL/SQL puzzle. If you've any technical question just mail me, i'll reply in short.
http://eclipsesql.sourceforge.net/
declare
v_offset number := 1;
v_buffer_size number := 1000;
v_file_handle UTL_FILE.FILE_TYPE;
v_src_lob blob;
v_len integer;
v_buffer raw(1000);
begin
/*select image_front into v_src_lob
from inward_image where rownum=1;*/
select img into v_src_lob
from image_upload where rownum=1;
v_len := DBMS_LOB.GETLENGTH(v_src_lob);
v_file_handle := UTL_FILE.FOPEN('IMAGE_TEST_DIR', 'f.pdf', 'wb');
while v_offset < v_Len
loop
DBMS_LOB.READ(v_src_lob, v_buffer_size, v_offset, v_buffer );
UTL_FILE.PUT_RAW(v_file_handle, v_buffer);
--DBMS_OUTPUT.PUT_LINE( v_offset || ' ' || v_buffer_size );
v_offset := v_offset + v_buffer_size;
end loop;
--DBMS_OUTPUT.PUT_LINE();
UTL_FILE.FFLUSH(v_file_handle);
UTL_FILE.FCLOSE(v_file_handle);
end;
declare
v_file_loc bfile;
v_Image_size integer;
v_img blob;
begin
--v_file_loc := bfilename('IMAGE_TEST_DIR', 'testRpt.pdf');
v_file_loc := bfilename('IMAGE_TEST_DIR', 'front.tif');
v_image_size := DBMS_LOB.GETLENGTH(v_file_Loc);
dbms_output.put_line(v_image_size);
insert into image_upload(id, img)
values (1, empty_blob()) returning img into v_img;
dbms_Lob.open(v_file_Loc, DBMS_LOB.FILE_READONLY );
DBMS_LOB.LOADFROMFILE( v_img,
v_file_loc,
v_image_size );
DBMS_LOB.CLOSE(v_file_Loc);
commit;
exception
when others then dbms_output.put_line('Exception : ' || sqlerrm);
end;