如果是游标错,那在sql server里就应该报错啊,可是在查询分析器里执行 use a go pr_kt go 补报错,执行的效果很好 ---------- 在delphi中 with StoredProc1 do begin Close; Prepare; Open; end; 就抱错, 为什么呢????????????????????? 我想不通
我试了 用QUERY 也抱同样的错 请告人指点
with StoredProc1 do begin Close; Prepare; StoredProc1.ExecProc ; end;
query.close;
query.sql.clear;
query.sql.add('exec stroeproc');
query.exec;
use a
go
pr_kt
go
补报错,执行的效果很好
----------
在delphi中
with StoredProc1 do
begin
Close;
Prepare;
Open;
end;
就抱错,
为什么呢?????????????????????
我想不通
用QUERY
也抱同样的错
请告人指点
begin
Close;
Prepare;
StoredProc1.ExecProc ;
end;
只能使用:EXECPROC;
QUERY只能用EXECSQL
不管你用什么来调用存储过程以及执行SQL语句,只要不返回结果集你就只能用ExecSQL或ExecProc来执行,如果你有结果集返回,你就可以用Open,如果你不想得到结果集,你也可以不用Open而用ExecSQL或ExecProc
最好在Store Procedure 里有返回值 @ReturnValue
declare @ReturnValue varchar(1)
在SQL分析器里用 Exec StoreProcName ParamName @ReturnValue out