请给出具体的命令和步骤~谢谢~
7 个解决方案
#1
exp/imp
#2
可以再详细一点不?
#3
1.写存储过程吧!好像没有直接的命令!
用odbc的话,用appendchunk和getchunk就可以,具体去msdn上查吧!有vb的例子!
用odbc的话,用appendchunk和getchunk就可以,具体去msdn上查吧!有vb的例子!
#4
能不能把网址给我?
#5
怎么没有人来呀~555555
#6
create table blob_test(rno number,photo blob);
create or replace directory IMAGE as 'e:\pic'
--存储图片的路径
CREATE OR REPLACE PROCEDURE insert_photo
(p_rno NUMBER, p_photo VARCHAR2)
AS
f_photo BFILE;
b_photo BLOB;
Begin
-- Update the employee photo
insert into blob_test values (p_rno,empty_blob())
RETURN picture into b_photo;
-- find where the photo's pointer is located.
f_photo := bfilename('IMAGE', p_photo);
-- open the photo as read-only option.
dbms_lob.fileopen(f_photo, dbms_lob.file_readonly);
-- load the photo into column photo.
dbms_lob.loadfromfile(b_photo,f_photo, dbms_lob.getlength(f_photo));
-- close the photo's pointer.
dbms_lob.fileclose(f_photo);
-- Save the loaded photo record.
COMMIT;
EXCEPTION
-- Check for your error messages
WHEN others THEN
dbms_output.put_line('*** ERROR *** Check you procedure.');
END;
/
存储过程只能读写服务器上的文件
其他的看下面
http://www.itpub.net/showthread.php?s=40657bec1a95805f83d1818034c72c85&threadid=7723
create or replace directory IMAGE as 'e:\pic'
--存储图片的路径
CREATE OR REPLACE PROCEDURE insert_photo
(p_rno NUMBER, p_photo VARCHAR2)
AS
f_photo BFILE;
b_photo BLOB;
Begin
-- Update the employee photo
insert into blob_test values (p_rno,empty_blob())
RETURN picture into b_photo;
-- find where the photo's pointer is located.
f_photo := bfilename('IMAGE', p_photo);
-- open the photo as read-only option.
dbms_lob.fileopen(f_photo, dbms_lob.file_readonly);
-- load the photo into column photo.
dbms_lob.loadfromfile(b_photo,f_photo, dbms_lob.getlength(f_photo));
-- close the photo's pointer.
dbms_lob.fileclose(f_photo);
-- Save the loaded photo record.
COMMIT;
EXCEPTION
-- Check for your error messages
WHEN others THEN
dbms_output.put_line('*** ERROR *** Check you procedure.');
END;
/
存储过程只能读写服务器上的文件
其他的看下面
http://www.itpub.net/showthread.php?s=40657bec1a95805f83d1818034c72c85&threadid=7723
#7
又发现一个问题,如过插入的blob字段的数值超过32k怎么办?
怎么进行动态的括充?
或者其他的办法?
怎么进行动态的括充?
或者其他的办法?
#1
exp/imp
#2
可以再详细一点不?
#3
1.写存储过程吧!好像没有直接的命令!
用odbc的话,用appendchunk和getchunk就可以,具体去msdn上查吧!有vb的例子!
用odbc的话,用appendchunk和getchunk就可以,具体去msdn上查吧!有vb的例子!
#4
能不能把网址给我?
#5
怎么没有人来呀~555555
#6
create table blob_test(rno number,photo blob);
create or replace directory IMAGE as 'e:\pic'
--存储图片的路径
CREATE OR REPLACE PROCEDURE insert_photo
(p_rno NUMBER, p_photo VARCHAR2)
AS
f_photo BFILE;
b_photo BLOB;
Begin
-- Update the employee photo
insert into blob_test values (p_rno,empty_blob())
RETURN picture into b_photo;
-- find where the photo's pointer is located.
f_photo := bfilename('IMAGE', p_photo);
-- open the photo as read-only option.
dbms_lob.fileopen(f_photo, dbms_lob.file_readonly);
-- load the photo into column photo.
dbms_lob.loadfromfile(b_photo,f_photo, dbms_lob.getlength(f_photo));
-- close the photo's pointer.
dbms_lob.fileclose(f_photo);
-- Save the loaded photo record.
COMMIT;
EXCEPTION
-- Check for your error messages
WHEN others THEN
dbms_output.put_line('*** ERROR *** Check you procedure.');
END;
/
存储过程只能读写服务器上的文件
其他的看下面
http://www.itpub.net/showthread.php?s=40657bec1a95805f83d1818034c72c85&threadid=7723
create or replace directory IMAGE as 'e:\pic'
--存储图片的路径
CREATE OR REPLACE PROCEDURE insert_photo
(p_rno NUMBER, p_photo VARCHAR2)
AS
f_photo BFILE;
b_photo BLOB;
Begin
-- Update the employee photo
insert into blob_test values (p_rno,empty_blob())
RETURN picture into b_photo;
-- find where the photo's pointer is located.
f_photo := bfilename('IMAGE', p_photo);
-- open the photo as read-only option.
dbms_lob.fileopen(f_photo, dbms_lob.file_readonly);
-- load the photo into column photo.
dbms_lob.loadfromfile(b_photo,f_photo, dbms_lob.getlength(f_photo));
-- close the photo's pointer.
dbms_lob.fileclose(f_photo);
-- Save the loaded photo record.
COMMIT;
EXCEPTION
-- Check for your error messages
WHEN others THEN
dbms_output.put_line('*** ERROR *** Check you procedure.');
END;
/
存储过程只能读写服务器上的文件
其他的看下面
http://www.itpub.net/showthread.php?s=40657bec1a95805f83d1818034c72c85&threadid=7723
#7
又发现一个问题,如过插入的blob字段的数值超过32k怎么办?
怎么进行动态的括充?
或者其他的办法?
怎么进行动态的括充?
或者其他的办法?