Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
if(wildmatch(EName,'SCOTT') >=1,Empno,
if(wildmatch(EName,'KING','President') and MGR = 'NULL',Empno,
What the above script will do?
Please explain.
Thanks in advance.
Hi,
WildMatch is used for a match where a string can be part of the search string.
Syntax:
wildmatch( str, expr1 [ , expr2,...exprN ] )
The wildmatch function performs a case insensitive comparison and permits the use of wildcard characters ( * and ?) in the comparison strings.
Example:
wildmatch( M, 'ja*','fe?','mar')
returns 1 if M = January
returns 2 if M = fex
Regards
Neetha
If it finds SCOTT (case sensitive) in the field ename it will give you the empno in those records. If it's not 'SCOTT' it will look for 'KING' or 'President' (again case matters) if it finds either of those EXACTLY as they are given in the script and the MGR field is null it will give you the empno for those records. If neither of those conditions are found it will return NULL.
WildMatch is essentially the same as match if you do not use a WildCard ('*' or '?') in the if statement.
In Ename field ,if scott value is found it gives matching Empno for that record,else
its checks for values 'KING' or 'President' and MGR field is Null it gives matching Empno for that record.
and no match found it returns Null.