正常的我用TSQLConnection+TSQLQuery 執行SQL的時候一切正常
但是我用TSQLConnection+TSQLStoredProc 訪問存盤程序的時候總是報'List index out of bounds(0)
存盤程序是
CREATE OR REPLACE PROCEDURE sp_lj(rc_result OUT VARCHAR2 --回傳結果
) IS
BEGIN
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;
執行結果是
uj5u.com熱心網友回復:

TSQLStoredProc 的屬性..
uj5u.com熱心網友回復:
沒有人用過嗎,汗水淋漓uj5u.com熱心網友回復:
問題有可能出在這一句edit2.Text := tmpSQLSP.ParamByName('RC_Result').Value;
你把這句拿掉試試
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/64649.html
標籤:數據庫相關
