求教关于程序执行后报错:sql statement dosen't return rows的有关问题
求教关于程序执行后报错:sql statement dosen't return rows的问题
大家帮我看下,为什么在最后面加orqry_ip.open,程序执行后会报错说:sql statement dosen't return rows
如果不加的话就不会报错,
procedure TForm1.btn_payment_planClick(Sender: TObject);
var
i: Integer;
i_input_value:string;
i_ip : string;
i_action : string;
begin
orqry.Close;
orqry_payment_plan.Close;
orqry_id.close
orqry.ParamByName('i_type_1').AsString := '支付方案';
orqry.ParamByName('i_type_2').AsString := 'default';
orqry.ExecSQL;
orqry_payment_plan.SQL.Clear;
i_input_value := edt_payment_plan.Text;
orqry_payment_plan.SQL.Text := Format(orqry.FieldByName('SQL_TEXT').AsString,
[QuotedStr(i_input_value),
QuotedStr(i_input_value)]);
orqry_payment_plan.ExecSQL;
cxgrd_payment_plan_view.ClearItems;
cxgrd_payment_plan_view.DataController.CreateAllItems();
for i:= 0 to cxgrd_payment_plan_view.DataController.ItemCount - 1 do
begin
Self.cxgrd_payment_plan_view.Columns[i].Width := 120;
end;
//以下部分通过调用一个存储过程把ip的使用情况记录到数据库表中,在界面中不展示出来
orqry.ParamByName('i_type_1').AsString := '记录IP使用记录';
orqry.ParamByName('i_type_2').AsString := 'default';
orqry.ExecSQL;
i_ip := idpwtch.LocalIP;
i_action := '支付方案';
orqry_ip.SQL.Text := Format(orqry.FieldByName('SQL_TEXT').AsString,
[QuotedStr(i_ip),
QuotedStr(i_action),
QuotedStr(i_input_value)]);
orqry_ip.ExecSQL;
orqry_payment_plan.Open;
orqry.Open;
orqry_ip.Open;//这一行如果不加不会报错,加的话会报说sql语句没有rows
end;
------解决方案--------------------
orqry_ip.ExecSQL;
你执行的是没有返回结果的sql语句,如update,insert,delete
open用于执行有返回结果的sql语句,如select
大家帮我看下,为什么在最后面加orqry_ip.open,程序执行后会报错说:sql statement dosen't return rows
如果不加的话就不会报错,
procedure TForm1.btn_payment_planClick(Sender: TObject);
var
i: Integer;
i_input_value:string;
i_ip : string;
i_action : string;
begin
orqry.Close;
orqry_payment_plan.Close;
orqry_id.close
orqry.ParamByName('i_type_1').AsString := '支付方案';
orqry.ParamByName('i_type_2').AsString := 'default';
orqry.ExecSQL;
orqry_payment_plan.SQL.Clear;
i_input_value := edt_payment_plan.Text;
orqry_payment_plan.SQL.Text := Format(orqry.FieldByName('SQL_TEXT').AsString,
[QuotedStr(i_input_value),
QuotedStr(i_input_value)]);
orqry_payment_plan.ExecSQL;
cxgrd_payment_plan_view.ClearItems;
cxgrd_payment_plan_view.DataController.CreateAllItems();
for i:= 0 to cxgrd_payment_plan_view.DataController.ItemCount - 1 do
begin
Self.cxgrd_payment_plan_view.Columns[i].Width := 120;
end;
//以下部分通过调用一个存储过程把ip的使用情况记录到数据库表中,在界面中不展示出来
orqry.ParamByName('i_type_1').AsString := '记录IP使用记录';
orqry.ParamByName('i_type_2').AsString := 'default';
orqry.ExecSQL;
i_ip := idpwtch.LocalIP;
i_action := '支付方案';
orqry_ip.SQL.Text := Format(orqry.FieldByName('SQL_TEXT').AsString,
[QuotedStr(i_ip),
QuotedStr(i_action),
QuotedStr(i_input_value)]);
orqry_ip.ExecSQL;
orqry_payment_plan.Open;
orqry.Open;
orqry_ip.Open;//这一行如果不加不会报错,加的话会报说sql语句没有rows
end;
------解决方案--------------------
orqry_ip.ExecSQL;
你执行的是没有返回结果的sql语句,如update,insert,delete
open用于执行有返回结果的sql语句,如select