-
1. Re: Proper use of the CHARINDEX function
shawkins Oct 26, 2017 8:34 AM (in response to adi22)There is no built-in charindex function, you may want to use locate instead.
-
2. Re: Proper use of the CHARINDEX function
adi22 Oct 27, 2017 1:21 AM (in response to adi22)Also, the ifnull function is not working.
TEIID30068 Remote org.teiid.api.exception.query.QueryResolverException: TEIID30068 The function 'ifnull(DC.DC_E_ERBS_EUTRANCELLFDD_DAYBH.pmRrcConnLevSum, 0, DC.DC_E_ERBS_EUTRANCELLFDD_DAYBH.pmRrcConnLevSum)' is an unknown form. Check that the function name and number of arguments is correct.
-
3. Re: Proper use of the CHARINDEX function
shawkins Oct 27, 2017 7:39 AM (in response to adi22)No, ifnull is defined as a two argument function. It looks like you may want a case expression.
-
4. Re: Proper use of the CHARINDEX function
adi22 Oct 27, 2017 10:36 AM (in response to shawkins)Yes. Is there any way by which we I can use ifnull with case expression?
-
5. Re: Proper use of the CHARINDEX function
shawkins Oct 27, 2017 10:45 AM (in response to adi22)1 of 1 people found this helpfulSorry, I don't understand your question.
Looking at your example again your first and third arguments are the same, so just don't include the third argument:
ifnull(DC.DC_E_ERBS_EUTRANCELLFDD_DAYBH.pmRrcConnLevSum, 0)
-
6. Re: Proper use of the CHARINDEX function
adi22 Oct 30, 2017 9:18 AM (in response to shawkins)My question is can we use ifnull function with three arguments? Is there any way or can we override the existing ifnull function?
-
7. Re: Proper use of the CHARINDEX function
shawkins Oct 30, 2017 9:22 AM (in response to adi22)Is there some reason that you need this functionality? Especially in this case the third argument is superfluous.
Since ifnull is a Teiid system function, you cannot override it directly. You would have to create a similarly named function in a different schema - but then you must also handle how it will push down to sources.