疾
疾风之龙
Unregistered / Unconfirmed
GUEST, unregistred user!
我在调用存储过程时一直很正常,最近突然调用时报错,如下
‘ADOStoredProcl:CommandText does not return a result set’
我的存储过程如下
CREATE proc tree
@qx varchar(2)='',
@a varchar(2)='02',
@b varchar(2)='03'
as
Declare @WhereStr varchar(200)
set @WhereStr=''
create table #temp1(fl_id varchar(8),fl_name varchar(12),fl_bm varchar(8))
insert into #temp1(fl_id,fl_name,fl_bm)
select fl_id,fl_name,fl_bm
from lev
if @qx='0'
set @WhereStr=@WhereStr+' and 1=1'
if @qx='1'
set @WhereStr=@WhereStr+' and fl_id not like'+''''+@b+'%'+''''
if @qx='2'
set @WhereStr=@WhereStr+' and fl_id not like'+''''+@a+'%'+''''
if @qx='3'
begin
set @WhereStr=@WhereStr+' and fl_id not like'+''''+@b+'%'+''''
set @WhereStr=@WhereStr+' and fl_id not like'+''''+@a+'%'+''''
end
EXEC('select * from lev where 1=1'+@WhereStr)
return
望大大教我该怎么处理,急求
‘ADOStoredProcl:CommandText does not return a result set’
我的存储过程如下
CREATE proc tree
@qx varchar(2)='',
@a varchar(2)='02',
@b varchar(2)='03'
as
Declare @WhereStr varchar(200)
set @WhereStr=''
create table #temp1(fl_id varchar(8),fl_name varchar(12),fl_bm varchar(8))
insert into #temp1(fl_id,fl_name,fl_bm)
select fl_id,fl_name,fl_bm
from lev
if @qx='0'
set @WhereStr=@WhereStr+' and 1=1'
if @qx='1'
set @WhereStr=@WhereStr+' and fl_id not like'+''''+@b+'%'+''''
if @qx='2'
set @WhereStr=@WhereStr+' and fl_id not like'+''''+@a+'%'+''''
if @qx='3'
begin
set @WhereStr=@WhereStr+' and fl_id not like'+''''+@b+'%'+''''
set @WhereStr=@WhereStr+' and fl_id not like'+''''+@a+'%'+''''
end
EXEC('select * from lev where 1=1'+@WhereStr)
return
望大大教我该怎么处理,急求