问题是这样 因为ado的原因 ,我采用存储过程向后台数据库提交 blob字段,但是同样的我在使用过程返回参数时 ,ADOStoredProc 的参数不知道怎样赋值 理论上讲 应当给过程一个类似blob定位器的东东才对 可是blob参数 是out的 呀 希望大虾指点 我郁闷了一天了 难道用微软提供的provider就不能解决这个问题吗
我的后台过程如下:
create or replace procedure pro_gettestblob(v_id varchar2,p_ftxt out blob) is
begin
select ftxt into p_ftxt from textblob where id=v_id for update;
--dbms_output.put_line(v_id);
end pro_gettestblob;
在客户端给怎样写呀 ! 在线等待
我的后台过程如下:
create or replace procedure pro_gettestblob(v_id varchar2,p_ftxt out blob) is
begin
select ftxt into p_ftxt from textblob where id=v_id for update;
--dbms_output.put_line(v_id);
end pro_gettestblob;
在客户端给怎样写呀 ! 在线等待
procedure TfrmResPaper.bbnSavePaperClick(Sender: TObject);
var
Query:TADOQuery;
Stream:TADOBlobStream;
begin
if not ((OlePaper.State=osLoaded) and
(DMResPaper.State=dsBrowse) and (DMResPaper.RecordCount>0)) then Exit;
Query:=TADOQuery.Create(nil);
with Query do
begin
Connection:=Pubconn;
SQL.Clear;
SQL.Add('SELECT ID,RES_NO,PAPER FROM B_PAPER WHERE ID='+DMResPaper.FieldByName('ID').AsString
+' AND RES_NO='''+DMResPaper.FieldByName('RES_NO').AsString+'''');
Open;
Edit;
Stream:=TADOBlobStream.Create(TBlobField(FieldByName('PAPER')),bmReadWrite);
try
try
OlePaper.SaveToStream(Stream);
finally
Stream.Free;
end;
Post;
EpsDLG('圖紙保存成功!');
except
EpsDLG('圖紙保存失敗!');
end;
Query.Free;
end;
end;//Load Paper
procedure TfrmResPaper.dgMainDblClick(Sender: TObject);
var
Query:TADOQuery;
Stream:TADOBlobStream;
begin
inherited;
if not ((DMResPaper.State=dsBrowse) and (DMResPaper.RecordCount>0)) then Exit;
Query:=TADOQuery.Create(nil);
with Query do
begin
Connection:=Pubconn;
SQL.Clear;
SQL.Add('SELECT ID,RES_NO,PAPER FROM B_PAPER WHERE ID='+DMResPaper.FieldByName('ID').AsString
+' AND RES_NO='''+DMResPaper.FieldByName('RES_NO').AsString+''' AND PAPER IS NOT NULL');
Open;
if RecordCount=0 then
OlePaper.DestroyObject
else
begin
Stream:=TADOBlobStream.Create(TBlobField(FieldByName('PAPER')),bmRead);
try
OlePaper.LoadFromStream(Stream);
finally
Stream.Free;
end;
end;
Query.Free;
end;
end;