调用oracle存储过程,参数blob类型怎么也传递不了,高人指点(100分)

  • 主题发起人 主题发起人 baguijin
  • 开始时间 开始时间
B

baguijin

Unregistered / Unconfirmed
GUEST, unregistred user!
表和存储过程<br>create table ttest<br>(<br>t1 varchar2(30) not null,<br>t2 varchar2(30) not null,<br>t3 date not null,<br>t4 NUMBER(4,2) not null<br>);<br>create or replace procedure PRO_test(<br> &nbsp;v_xh &nbsp; &nbsp; &nbsp;in &nbsp; &nbsp;VARCHAR2, &nbsp;<br> &nbsp;v_xh2 &nbsp; &nbsp; in &nbsp; &nbsp;varchar2, &nbsp;<br> &nbsp;v_xh3 &nbsp; &nbsp; in &nbsp; &nbsp;date,<br> &nbsp;v_xh4 &nbsp; &nbsp; in &nbsp; &nbsp;number,<br> &nbsp;v_photo1 &nbsp;in &nbsp; blob, &nbsp;--第一张图片 &nbsp;<br> &nbsp;v_res &nbsp; &nbsp; out &nbsp;varchar2 &nbsp; &nbsp;<br>) is<br>begin<br> &nbsp;v_res:='0'; <br> &nbsp;insert into ttest(t4,t1,t2,t3) values(v_xh4,v_xh,v_xh2,v_xh3);<br> &nbsp;commit;<br>end PRO_test;<br>/<br>delphi调用存储过程:<br> &nbsp;SP_wchufa.Parameters.Clear;<br><br> &nbsp;SP_wchufa.Parameters.Add;<br> &nbsp;SP_wchufa.Parameters[0].Name:='V_XH';<br> &nbsp;SP_wchufa.Parameters[0].DataType:=ftString;<br> &nbsp;SP_wchufa.Parameters[0].Direction:=pdinput;<br> &nbsp;SP_wchufa.Parameters[0].Size:=2000;<br><br> &nbsp;SP_wchufa.Parameters.Add;<br> &nbsp;SP_wchufa.Parameters[1].Name:='V_xh2';<br> &nbsp;SP_wchufa.Parameters[1].DataType:=ftString;<br> &nbsp;SP_wchufa.Parameters[1].Direction:=pdinput;<br> &nbsp;SP_wchufa.Parameters[1].Size:=2000;<br><br> &nbsp; &nbsp;SP_wchufa.Parameters.Add;<br> &nbsp;SP_wchufa.Parameters[2].Name:='V_xh3';<br> &nbsp;SP_wchufa.Parameters[2].DataType:=ftdate;<br> &nbsp;SP_wchufa.Parameters[2].Direction:=pdinput;<br> &nbsp;SP_wchufa.Parameters[2].Size:=2000;<br><br> &nbsp; &nbsp;SP_wchufa.Parameters.Add;<br> &nbsp;SP_wchufa.Parameters[3].Name:='V_xh4';<br> &nbsp;SP_wchufa.Parameters[3].DataType:=ftBCD;<br> &nbsp;SP_wchufa.Parameters[3].Direction:=pdinput;<br> &nbsp;SP_wchufa.Parameters[3].Precision:=4;<br> &nbsp;SP_wchufa.Parameters[3].Size:=0;<br><br> &nbsp;SP_wchufa.Parameters.Add;<br> &nbsp;SP_wchufa.Parameters[4].Name:='V_PHOTO1';<br> &nbsp;SP_wchufa.Parameters[4].DataType:=ftBlob;<br> &nbsp;SP_wchufa.Parameters[4].Direction:=pdinput;<br> &nbsp;SP_wchufa.Parameters[4].Size:=999;<br><br> &nbsp;SP_wchufa.Parameters.Add;<br> &nbsp;SP_wchufa.Parameters[5].Name:='V_RES';<br> &nbsp;SP_wchufa.Parameters[5].DataType:=ftString;<br> &nbsp;SP_wchufa.Parameters[5].Direction:=pdoutput;<br> &nbsp;SP_wchufa.Parameters[5].Size:=2000;<br><br> &nbsp;SP_wchufa.Parameters.ParamByName('V_XH').Value:='1234566666666666';<br> &nbsp;SP_wchufa.Parameters.ParamByName('V_xh2').Value:='210';<br> &nbsp;SP_wchufa.Parameters.ParamByName('V_xh3').Value:='2006-08-15 13:32:30';<br> &nbsp;SP_wchufa.Parameters.ParamByName('V_xh4').Value:=4.2;<br> &nbsp;SP_wchufa.Parameters.ParamByName('v_photo1').LoadFromFile('d:/pic/20060621194742-03-01-103.jpg',ftBlob);<br> &nbsp;SP_wchufa.Prepared:=true;<br> &nbsp;try<br> &nbsp; &nbsp;SP_wchufa.ExecProc;<br> &nbsp;finally<br> &nbsp;end;<br>问题在哪里呀??试了两天也,就是blob参数过不去,如果没有blob参数存储过程是好用的。先谢谢了!
 
等待高人
 
没有人遇到这个问题吗?
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
855
DelphiTeacher的专栏
D
S
回复
0
查看
937
SUNSTONE的Delphi笔记
S
后退
顶部