正常的我用TSQLConnection+TSQLQuery 执行SQL的时候一切正常但是我用TSQLConnection+TSQLStoredProc 访问存储过程的时候总是报'List index out of bounds(0)存储过程是
CREATE OR REPLACE PROCEDURE sp_lj(rc_result OUT VARCHAR2 --返回结果
) ISBEGIN
rc_result := ' ';
exception
when others then
rc_result := '0::处理时出错 ' || SQLERRM;
ROLLBACK;
RETURN;
END;
客户端调用是
procedure TForm1.Button2Click(Sender: TObject);
begin
SQLConnection1.Connected := true;
if SQLConnection1.Connected then
showmessage('OK') else showmessage('not OK'); tmpSQLSP.close;
tmpSQLSP.StoredProcName :='sp_lj';
//tmpSQLSP.SchemaName:='dbo';
tmpSQLSP.Params.Clear;
tmpSQLSP.Params.CreateParam(ftString, 'rc_result', ptOutput); try
tmpSQLSP.ExecProc;//这里执行出错
except
on e: exception do
begin
showmessage(e.Message);
exit;
end;
end;
edit2.Text := tmpSQLSP.ParamByName('RC_Result').Value; tmpSQLSP.Free;
end;执行结果是
CREATE OR REPLACE PROCEDURE sp_lj(rc_result OUT VARCHAR2 --返回结果
) ISBEGIN
rc_result := ' ';
exception
when others then
rc_result := '0::处理时出错 ' || SQLERRM;
ROLLBACK;
RETURN;
END;
客户端调用是
procedure TForm1.Button2Click(Sender: TObject);
begin
SQLConnection1.Connected := true;
if SQLConnection1.Connected then
showmessage('OK') else showmessage('not OK'); tmpSQLSP.close;
tmpSQLSP.StoredProcName :='sp_lj';
//tmpSQLSP.SchemaName:='dbo';
tmpSQLSP.Params.Clear;
tmpSQLSP.Params.CreateParam(ftString, 'rc_result', ptOutput); try
tmpSQLSP.ExecProc;//这里执行出错
except
on e: exception do
begin
showmessage(e.Message);
exit;
end;
end;
edit2.Text := tmpSQLSP.ParamByName('RC_Result').Value; tmpSQLSP.Free;
end;执行结果是
解决方案 »
- delphi 名称修改出错
- 如何实现将 SQL Server 2000 中的数据导出为XML格式的文件啊?
- 为什么ClientDataSet的Filter不支持like
- 一个c/s型进销存系统 可以卖多少钱?
- 讨论一下数据库结构建立问题。
- 请教高手 在线等待
- oracle数据库升级(7->8),出现的问题
- 我用一个ADOCONN,ADODATASOURCE,ADODATASET取得一组数据,请问我怎么用代码来控制指针下移,以及用代码取得当前某个字段的值?
- l_jia()近来领分6
- 怎样打印tiff图形呢
- matlab导入一个图片,点击不同位置产生坐标矩阵
- 麻烦大师帮我查错,将一段VB声明如何转换成DELPHI代码
TSQLStoredProc 的属性..
edit2.Text := tmpSQLSP.ParamByName('RC_Result').Value;
你把这句拿掉试试