Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- declare cust_trn cursor local for SELECT * FROM [dbo].[Q03_Create_Customer_Trn](@COUNTERPARTY)
- IF CURSOR_STATUS('local','cust_trn') <>-1
- BEGIN
- OPEN cust_trn
- END
- FETCH NEXT FROM cust_trn INTO @trn,@cust_name;
- WHILE @@FETCH_STATUS=0
- BEGIN
- IF (@LIST1 IS NULL) BEGIN
- SET @LIST1= @cust_name;
- END
- ELSE BEGIN
- SET @LIST1=ISNULL(@LIST1, '') + ';' + ISNULL(@cust_name, '');
- END
- FETCH NEXT FROM cust_trn INTO @trn,@cust_name; END END ELSE BEGIN SET @LIST1 = 'N/A'; END CLOSE cust_trn ; DEALLOCATE cust_trn; RETURN ISNULL(@LIST1,'N/A'); END; ISNULL(@LIST1,'N/A'); END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement