cesark
Programmer
- Dec 20, 2003
- 621
Is this syntax correct? (The part in bold)
I want when the output parameter @Other_Certificates is Null return ‘null’ so that none Certificate_id is found, and when it is not Null return number 8 so that the Certificate_id number 8 is found. How can I do it?
Thank you,
Cesar
Code:
...
SET NOCOUNT ON
-- These are delcared output parameters
SELECT @Certificate_Gest0 = Certificate_Gest1, @Certificate_Gest1 = Certificate_Gest2,
@Certificate_Gest2 = Certificate_Gest3, @Certificate_Gest3 = Certificate_Gest4,
@Certificate_Gest4 = Certificate_Gest5, @Certificate_Gest5 = Certificate_Gest6,
@Certificate_Gest6 = Certificate_Gest7, @Other_Certificates = Other_Certificates
FROM CertGest_Offer
WHERE Offer_num = @Offer_id
SET NOCOUNT OFF
SET NOCOUNT ON
SELECT Certificate_id, Certificate_name
FROM Certificates
WHERE Certificate_id IN (@Certificate_Gest0, @Certificate_Gest1, @Certificate_Gest2, @Certificate_Gest3, @Certificate_Gest4, @Certificate_Gest5, @Certificate_Gest6, [B]Case @Other_Certificates When NULL THEN NULL ELSE '8' END[/B])
SET NOCOUNT OFF
GO
I want when the output parameter @Other_Certificates is Null return ‘null’ so that none Certificate_id is found, and when it is not Null return number 8 so that the Certificate_id number 8 is found. How can I do it?
Thank you,
Cesar