Forum Discussion
Mike_Gorski_625
May 03, 2018Nimbostratus
Issues with Table Lookup command
Hello, I'm looking on some information about the expected output and data-type for "table lookup" especially in corner cases (entry does not exist, etc). In the Wiki it does not specify the o...
Mike_Gorski_625
May 03, 2018Nimbostratus
Now that I dig deeper I am seeing documented examples of iRule code using "table lookup" with numeric and string comparisons interchangeably
if { [table lookup -notouch $mykey] equals "" } {
table set $mykey "1" $timeout $timeout
}
Note, the above example uses "equals" (a string comparison) and subsequent table set command uses "1" (a string value).
if { [table lookup -notouch $mykey] == "" } {
table set $mykey 1 $timeout $timeout
}
Above, uses numeric comparison (==) and subsequent set command uses numeric 1 (not string).
So I think the assumption is that any needed type-casting will be handled gracefully. It still doesn't explain the error condition we ran into.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects