Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
shubhada
Posting Yak Master
117 Posts |
Posted - 2006-02-21 : 08:45:52
|
| I have one procedure SET QUOTED_IDENTIFIER OFF GOSET ANSI_NULLS ON GOcreate Proc cm_test ( @claimid char(20) = NULL, @payfromdt smalldatetime = NULL, @paytodt smalldatetime = NULL, @processfromdt smalldatetime = NULL, @processtodt smalldatetime = NULL)AsBegindeclare @ClaimID char(20), @EventID numeric(12,0), @CoinsurancePd money , @DeductPd money, @deductPd money, @coinsPd money, @outded money, @outcoins money, @precClaimID char(20), @paymntamt money, @addtlpayamt money, @adjamt money, @balancetransamt moneyset nocount on select @precClaimID ='TEST' declare @string1 varchar(255), @string2 varchar(255), @string3 varchar(255)SELECT @string1 = 'select ClaimID,EventID from PaymentsDetail'exec (@string1)DECLARE PayDedCoins CURSOR FOR Exec (@string1) open PayDedCoins FETCH PayDedCoins INTO @ClaimID,@EventIDWHILE @@Fetch_Status = 0 BEGIN exec cm_get_payment_dedcoins @ClaimID,@EventID end FETCH PayDedCoins INTO @ClaimID,@EventIDEND CLOSE PayDedCoinsDeallocate PayDedCoins returnEndHere Exec (@string1) statement returns 50 ClaimID and EventID .those ClaimID and EventID ,I want to pass to exec cm_get_payment_dedcoins statement which is written in cursor .Is it possible to write a exec (@string1) in cursore instead of select statementPlease help me to overcome from this problem.shubhada |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-02-21 : 08:47:47
|
no it is not.you do not want that.Go with the flow & have fun! Else fight the flow |
 |
|
|
shubhada
Posting Yak Master
117 Posts |
Posted - 2006-02-21 : 09:09:43
|
| how i can overcome this problem?i used this approch because every time my query is changed .shubhada |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
|
|
|
|
|