关于BCB EXECSQL
问题描述:
我有如下一段SQL语句,在程序中使用 EXECSQL()来执行,但是不行,我想问下下面这段难道不是标准SQL,或者不能被TADOQuery 的EXECSQL()来执行?能帮忙改改吗?小弟菜鸟,麻烦各位不吝赐教~
错误提示如下:不正常的定义参数对象,提供了不一致或不完整的信息。
- SQL code
declare i integer; j integer; num integer;begin i := 1; j := 9000; num := 0; select Count(*) into num from t_pb_logo_flow; while num > 0 loop update t_pb_logo_flow set seqno = i where seqno = j; i := i + 1; j := j + 1; num := num - 1; end loop; commit;end;
[解决办法]
declare这样的肯定不是不被execsql识别的
用存储过程吧
[解决办法]
上面的回答没一个切中要点的, 这个sql语法的问题。
declare
i integer;
j integer;
num integer;
begin
set i = 1
set j = 9000
set num = 0
select num = Count(*) from t_pb_logo_flow;
while num > 0
being
update t_pb_logo_flow set seqno = i where seqno = j;
set i = i + 1;
set j = j + 1;
set num = num - 1;
end;
end;