Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

about stored procedure

Status
Not open for further replies.

jepe666

Programmer
Apr 17, 2008
36
0
0
ID
I using stored procedure in my report..but why i did't find any field in it??
so i can't create report table without field in dataset(stored procedure)

please help..
 
Use the "Refresh Fields" button

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
I already use refresh field but doesn't work,there isn't field in data set..
My store procedure like :
STORE PROCEDURE [dbo].[sp_cast]
@userid char(50),
@cpny char(3),
@PBegin datetime,
@PEnd datetime,
@jenis char(10)

AS
BEGIN
sets from
SET NOCOUNT ON;
DECLARE @jmlRequest int,
@bln char(2),
@thn char(4),
@jns char(10),
@jab char(50)

DECLARE BR cursor for

select sum(jmlrequest), month(wktpelaksanaan),year(wktPelaksanaan),jns,kdjab
from BRBArequest
where jns=@jenis and wktpelaksanaan between @PBegin and @PEnd
group by jns, month(wktpelaksanaan),year(wktPelaksanaan),kdjab
OPEN BR
FETCH NEXT FROM BR INTO @jmlRequest, @bln, @thn, @jns, @jab
WHILE (@@FETCH_STATUS = 0)
BEGIN
update BRBATempRealisasiDet setJmlReq=@jmlRequest
where KdBR=@jns and userid=@userid and CompanyID=@cpny and Bln=@bln and Thn=@thn

DECLARE @jmlBAAdjst int,
@test varchar(250)
DECLARE BA cursor for
select (sum(CtrlTot)-sum(CtrlTotAdjst)) as Expr1 from BRBARealisasi A
inner join BRBARequest B on A.BatchNo=B.BatchNo and month(B.wktpelaksanaan)=@bln and year(B.wktpelaksanaan)=@thn and B.jns=@jns
OPEN BA
FETCH NEXT FROM BA INTO @jmlBAAdjst
WHILE (@@FETCH_STATUS = 0)
BEGIN
update BRBATempRealisasiDet set JmlBA= @jmlBAAdjst
where userid=@userid and CompanyID= @cpny and KdBR= @jns
and bln= @bln and thn= @thn
FETCH NEXT FROM BA INTO @jmlBAAdjst
END
CLOSE BA
DEALLOCATE BA
FETCH NEXT FROM BR INTO @jmlRequest, @bln, @thn, @jns, @jab
END
CLOSE BR
DEALLOCATE BR
update BRBATempRealisasiDet set JmlReq='0', JmlBA='0'
where JmlReq is null and JmlBa is null
update BRBATempRealisasiDet set JmlBudget='0'
where JmlBudget is null

END
 
Well does the SP return data?

How are you calling it in RS?

Please provide the actual tetx that you are suing to call the SP

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
because yoy set the no count on the last teransaction only will be returned by the stored procedure which is an update, you might be able to see stuff in SQL but reporting needs a dataset to work with,

add a select statement as the last statement of the stored proc to return whatever data it is that you need

-Mo

If you don't stand for something, you'll fall for anything
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top