Question : SQL : STORED PROCEDURE IN CRYSTAL REPORTS

hi all

i have the below sql sp, which when run in sql returns many rows as expected,

when i use crystal reports to display the results from the sp, it shows only the first result and ends

can anyone help me show all the row results in crystal?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
create procedure sp_mr_geof2(@parent_part varchar(100) )
as

DECLARE @STOCK_ID int

DECLARE STOCKCHECK CURSOR FOR
select   STOCK_ID from  BomStructure with (NOLOCK), STOCK_MASTER SM 
 where ParentPart = @parent_part
   and Route = 0 
   and ERP_STOCK_CODE = Component 
order by STOCK_ID


OPEN STOCKCHECK

FETCH NEXT FROM STOCKCHECK INTO
  @STOCK_ID

WHILE @@FETCH_STATUS = 0
  BEGIN

  exec SP_CREATE_PICK_PIECE @STOCK_ID,-1,'AF',0,-1,2,0,1,0,1,0,0,0,44
FETCH NEXT FROM STOCKCHECK INTO
  @STOCK_ID

  END


CLOSE STOCKCHECK
DEALLOCATE STOCKCHECK

Answer : SQL : STORED PROCEDURE IN CRYSTAL REPORTS


Hey

You may need to
DEALLOCATE STOCKCHECK

as it will still exist next time you call the procedure if you don't

Random Solutions  
 
programming4us programming4us