Hello,
Within an INSERT statement where the VALUES are expressed, is it
possible to evaluate one or more of the values with CASE or IF
statements?
Consider the following code;
INSERT INTO snbat011_app_clnt
(entr_cd,
app_id,
clnt_id,
clnt_type,
clnt_frst_name,
clnt_mid_name,
clnt_lst_name,
clnt_gender)
VALUES
(@EntrCode, @AppId, @ClientId, @FirstName, @MidName, @LastName,
If @FormType = 'SimplifiedApp Or (@FormType = 'AccidentApp' And @FormId
= 'AccidentAppRls0304') Then
@Gender
Else
'' )
The entry of a value for clnt_gender depends on the statements in the
If condition. If one condition is met, then the parameter value in
@Gender is used, otherwise, the entry is an empty string.
How would you recommend that I handle this kind of situation?
Thank you for your help!
CSDunn