X
xxczq
Unregistered / Unconfirmed
GUEST, unregistred user!
我用Oracle 作后台,作了一个图象插入的例子,是 通过调用过程实现的,过程原代码如下:
create or repalce procedure insertimage(
imgid in number,
image in blob)
as
begin
insert into images(imgid,image);
commit;
end;
前端
procedure TForm1.Btn_InsertImgClick(Sender: TObject);
//procedure TForm1.BitBtn1Click(Sender: TObject);
var strm:tmemorystream;
begin
OpenDialog1.Execute;
strm:=tmemorystream.Create;
try
strm.LoadFromFile(OpenDialog1.FileName);
//adoconnection1.Connected:=true;
sp_InsertImg.Close;
//StoredProc1.ProcedureName:='test_proc1';
//StoredProc1.Parameters.Refresh;
sp_InsertImg.ParamByName('imgid').Value:=2;
sp_InsertImg.ParamByName('image').LoadFromStream(strm,ftblob);
//StoredProc1.Prepared;
sp_InsertImg.ExecProc;
finally
strm.Free;
end;
end;
有的BMP图可以插入,有的就不行,提示说‘转换无法完成或请求不合理’为什么?
create or repalce procedure insertimage(
imgid in number,
image in blob)
as
begin
insert into images(imgid,image);
commit;
end;
前端
procedure TForm1.Btn_InsertImgClick(Sender: TObject);
//procedure TForm1.BitBtn1Click(Sender: TObject);
var strm:tmemorystream;
begin
OpenDialog1.Execute;
strm:=tmemorystream.Create;
try
strm.LoadFromFile(OpenDialog1.FileName);
//adoconnection1.Connected:=true;
sp_InsertImg.Close;
//StoredProc1.ProcedureName:='test_proc1';
//StoredProc1.Parameters.Refresh;
sp_InsertImg.ParamByName('imgid').Value:=2;
sp_InsertImg.ParamByName('image').LoadFromStream(strm,ftblob);
//StoredProc1.Prepared;
sp_InsertImg.ExecProc;
finally
strm.Free;
end;
end;
有的BMP图可以插入,有的就不行,提示说‘转换无法完成或请求不合理’为什么?