Layer7 API Management

  • 1.  peform jdbc with case inscensitive

    Posted Feb 27, 2019 01:05 PM

    Hi There,am using following query which is getting failed,essentially if receive in the request the capital letter i want to convert in to lower case search. I tried with the below which is failing.Pls advie.Since we store the resource owner in lower letters and in the json request we may receive few letter with capital.

    ${resource_owner} this is variable which resolves to an emailID.

    SELECT custom FROM oauth_token where resource_owner = lower('${resource_owner}') ORDER BY created DESC



  • 2.  Re: peform jdbc with case inscensitive

    Broadcom Employee
    Posted Feb 27, 2019 05:13 PM

    It seems you want to use context variable in your perform jdbc query assertion, in that case, you may try remove the single quote on the context variable.



  • 3.  Re: peform jdbc with case inscensitive

    Broadcom Employee
    Posted Mar 11, 2019 11:20 AM

    Hi,

     

    Did the answers on this thread answered your question? If it did please mark it as the right answer.
    When your question is not answered or you still have additional questions please let us know.

     

    With Kind Regards
    Dirk



  • 4.  Re: peform jdbc with case inscensitive

    Posted Mar 12, 2019 06:16 PM

    It isn't working,however will double check it.Pls allow me some time will get back to on this.



  • 5.  Re: peform jdbc with case inscensitive

    Broadcom Employee
    Posted Mar 12, 2019 06:50 PM

    Hello,

    you cannot use single quotation around the context variable in the SQL statement.

    As per my test, when parse the context variable, it will add single quote around the value,

    ie.

    ... lower ('${something}') ...

    will be parsed to,

    ... lower (''******'') ...

     

    That will cause syntax error.

     

    to compare, without the quotation,

    ... lower (${something}) ...

    will be parsed to,

    ... lower ('******') ...

     

    which is in correct syntax.

     

    Regards,

    Mark