Aleks
asked on
Show are if a parameter is not NULL
I have a stored procedure that updates a record.
I need to add code so that it only runs IF the parameter passed has a value
The parameter is: request.querystring("marri ageidspous e")
If the parameter does existing run the SP code, something like:
What would the correct syntax be?
Sometimes the part of the URL passes no value like: marriageidspouse=
I am using classic ASP
I need to add code so that it only runs IF the parameter passed has a value
The parameter is: request.querystring("marri
If the parameter does existing run the SP code, something like:
IF request.querystring("marriageidspouse") <> NULL THEN
MY CODE
END IF
What would the correct syntax be?
Sometimes the part of the URL passes no value like: marriageidspouse=
I am using classic ASP
ASKER
I tried this but did not work:
I tried the code above and the one below:
I tried the code above and the one below:
<% If Not isNull request("marriageidspouse") or request("marriageidspouse") <> "" Then %>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This seems to have worked:
<% If Not isNull (request("marriageidspouse")) AND (request("marriageidspouse")) <> "" Then %>
just use empty string
IF request.querystring("marriageidspouse") <> "" THEN
MY CODE
END IF
@HK
how is your answer in any ways different than what I already suggested? Please don't repeat answers, its unnecessary, especially after an answer has already been accepted.
how is your answer in any ways different than what I already suggested? Please don't repeat answers, its unnecessary, especially after an answer has already been accepted.
when I posted it, it was not closed/accepted...
also, there is no mention of opening and closing tags anywhere...
+ 1st post is wrong and all post mentions using isNull...
when there is no such key exists or nothing is passed as value, it is converted to empty string...
also, there is no mention of opening and closing tags anywhere...
+ 1st post is wrong and all post mentions using isNull...
when there is no such key exists or nothing is passed as value, it is converted to empty string...
ASKER
Ok now it's closed. Thx to both.
Open in new window