R
rufeng
Unregistered / Unconfirmed
GUEST, unregistred user!
我用storedproc1 连sybase数据库,结果没有返回值。
with storedproc1do
begin
close;
OpenDatabase;
Params.Clear;
StoredProcName:='dbo.user_get_twofingerno;1';
Params.CreateParam(ftfloat,'@i_count',ptinput);
Params.CreateParam(ftstring,'@o_first_no',ptoutput);
Params.CreateParam(ftstring,'@o_second_no',ptoutput);
params[0].Size:=10;
params[0].NumericScale:=0;
params[1].Size:=13;
params[2].size:=13;
params[0].Value :=s_count;
prepare;
//try
execproc;
t_no:=parambyname('@o_first_no').asstring ;
m_no:=parambyname('@o_second_no').AsString ;
messagebox(0,pchar(t_no),'1',mb_ok);
result:=true;
// except
unprepare;
close;
result:=false;
存储过程如下:
CREATE PROCEDURE dbo.user_get_twofingerno
@i_count numeric(13,0),@o_first_no char(13) output,@o_second_no char(13) output
AS
declare @no_count numeric(13,0)
declare @no char(13)
declare @ii int
begin
declare cur1 cursor for select finger_no fromdo
n_record_fingerprint order by finger_no
open cur1
select @ii=0
select @no_count=0
while (@@sqlstatus!=2) and (@ii<>2)
begin
fetch cur1 into @no
select @no_count=@no_count+1
if @no_count=@i_count
begin
select @o_first_no=ltrim(rtrim(@no))
end
else
if @no_count=2*@i_count
begin
select @o_second_no=ltrim(rtrim(@no))
select @ii=2
end
end
close cur1
deallocate cursor cur1
END
return
我用storeproc1.open时,报error creating cursor handle!
请富翁们帮我看看!
with storedproc1do
begin
close;
OpenDatabase;
Params.Clear;
StoredProcName:='dbo.user_get_twofingerno;1';
Params.CreateParam(ftfloat,'@i_count',ptinput);
Params.CreateParam(ftstring,'@o_first_no',ptoutput);
Params.CreateParam(ftstring,'@o_second_no',ptoutput);
params[0].Size:=10;
params[0].NumericScale:=0;
params[1].Size:=13;
params[2].size:=13;
params[0].Value :=s_count;
prepare;
//try
execproc;
t_no:=parambyname('@o_first_no').asstring ;
m_no:=parambyname('@o_second_no').AsString ;
messagebox(0,pchar(t_no),'1',mb_ok);
result:=true;
// except
unprepare;
close;
result:=false;
存储过程如下:
CREATE PROCEDURE dbo.user_get_twofingerno
@i_count numeric(13,0),@o_first_no char(13) output,@o_second_no char(13) output
AS
declare @no_count numeric(13,0)
declare @no char(13)
declare @ii int
begin
declare cur1 cursor for select finger_no fromdo
n_record_fingerprint order by finger_no
open cur1
select @ii=0
select @no_count=0
while (@@sqlstatus!=2) and (@ii<>2)
begin
fetch cur1 into @no
select @no_count=@no_count+1
if @no_count=@i_count
begin
select @o_first_no=ltrim(rtrim(@no))
end
else
if @no_count=2*@i_count
begin
select @o_second_no=ltrim(rtrim(@no))
select @ii=2
end
end
close cur1
deallocate cursor cur1
END
return
我用storeproc1.open时,报error creating cursor handle!
请富翁们帮我看看!