Z
ZhongDe
Unregistered / Unconfirmed
GUEST, unregistred user!
CREATE PROCEDURE zdChaKanBianMa
@cCode char(10)
AS
Declare zdItem SCROLL CURSOR FOR
Select t1.FItemID
From t_Item t1 ,t_ICItem x2
where FItemClassID = 4 AND t1.FItemID=x2.FItemID AND t1.FDeleteD=0 And (t1.FNumber Like @cCode AND t1.FDetail=1) /*'A1%'*/
ORDER BY t1.FNumber 这样查不到数据,把此处的@cCode换为 'A1%',就能查到数据
在Delphi中调用,报告没有这个参数
create table #ItemID(FItemID int not null)
Open zdItem
Declare @Item int
Fetch zdItem into @item
While @@Fetch_status<>-1
Begin
INSERT INTO #ItemID(FItemID) Values(@Item)
Fetch zdItem into @Item
End
Close zdItem
deallocate zdItem
select t1.FItemID,t1.FNumber,t1.FLevel,t1.FName,t1.FShortNumber,t1.FDetail,t3.FModel FROM dbo.t_Item t1,#ItemID t2,t_ICItem t3 WHERE t1.FItemID=t2.FItemID and t2.FItemID*=t3.FItemID
drop table #ItemID
GO
请问错在哪里?
@cCode char(10)
AS
Declare zdItem SCROLL CURSOR FOR
Select t1.FItemID
From t_Item t1 ,t_ICItem x2
where FItemClassID = 4 AND t1.FItemID=x2.FItemID AND t1.FDeleteD=0 And (t1.FNumber Like @cCode AND t1.FDetail=1) /*'A1%'*/
ORDER BY t1.FNumber 这样查不到数据,把此处的@cCode换为 'A1%',就能查到数据
在Delphi中调用,报告没有这个参数
create table #ItemID(FItemID int not null)
Open zdItem
Declare @Item int
Fetch zdItem into @item
While @@Fetch_status<>-1
Begin
INSERT INTO #ItemID(FItemID) Values(@Item)
Fetch zdItem into @Item
End
Close zdItem
deallocate zdItem
select t1.FItemID,t1.FNumber,t1.FLevel,t1.FName,t1.FShortNumber,t1.FDetail,t3.FModel FROM dbo.t_Item t1,#ItemID t2,t_ICItem t3 WHERE t1.FItemID=t2.FItemID and t2.FItemID*=t3.FItemID
drop table #ItemID
GO
请问错在哪里?