EHSH
سه شنبه 20 تیر 1391, 12:17 عصر
با سلام خدمت همه اساتید محترم :
من یک اسکرپت دارم به شرح ذیل می خواهم ببینم یک متغییری مه تعریف شده چه جوری از داخل کرسر ، مقدار فیلد رکورد جاری بهش بدم ؟
i give error , please tel my how i can fill sum with Avamel value ?
-------------------------------------
SET NOCOUNT ON;
Declare @90000119 varchar(8),@sum varchar(50)
Declare @cslPricingFactorRef varchar(3),@Avamel varchar(50)
SET @90000119 = 0;@Sum=0
Declare spid_List2 Cursor FORWARD_ONLY For
SELECT cslPricingFactorRef,Avamel
from V_Factor_Total4
Open spid_List2
Fetch Next From spid_List2 into @cslPricingFactorRef,@Avamel
While @@Fetch_Status = 0
Begin
select
CASE
WHEN (@cslPricingFactorRef= 90000119) THEN (SELECT @sum=@Avamel)
END
Fetch Next From spid_List2 into @cslPricingFactorRef,@Avamel
End
Close spid_List2
Deallocate spid_List2
من یک اسکرپت دارم به شرح ذیل می خواهم ببینم یک متغییری مه تعریف شده چه جوری از داخل کرسر ، مقدار فیلد رکورد جاری بهش بدم ؟
i give error , please tel my how i can fill sum with Avamel value ?
-------------------------------------
SET NOCOUNT ON;
Declare @90000119 varchar(8),@sum varchar(50)
Declare @cslPricingFactorRef varchar(3),@Avamel varchar(50)
SET @90000119 = 0;@Sum=0
Declare spid_List2 Cursor FORWARD_ONLY For
SELECT cslPricingFactorRef,Avamel
from V_Factor_Total4
Open spid_List2
Fetch Next From spid_List2 into @cslPricingFactorRef,@Avamel
While @@Fetch_Status = 0
Begin
select
CASE
WHEN (@cslPricingFactorRef= 90000119) THEN (SELECT @sum=@Avamel)
END
Fetch Next From spid_List2 into @cslPricingFactorRef,@Avamel
End
Close spid_List2
Deallocate spid_List2