开发者

Btrim function is not working properly in PostgreSQL

开发者 https://www.devze.com 2023-01-18 16:26 出处:网络
Here, I have a problem in the va开发者_运维问答lue from trim() functionin PostgreSQL: Ruby code:

Here, I have a problem in the va开发者_运维问答lue from trim() function in PostgreSQL:

Ruby code:

    if(this.modelName=="ClientOffice")
       {    this.params="model_name="+this.modelName+"&action_name="+this.actionName+"&
find_condition=btrim(clients_corporate_billings.id,' ') %3D 
btrim('"+validString('populateValue0','text')+"',' ')
  & object_id="+this.objectId;
      }

 &action_name="+this.actionName+"
    &find_condition=btrim(clients_corporate_billings.id,' ') %3D
     btrim('"+validString('populateValue0','text')+"',' ')

In above code, btrim is function of PostgreSQL for trimming but it gives/produce error.


From the documentation.

Function: btrim(string text [, characters text])
Return Type: text
Description: Remove the longest string consisting only of characters in characters (a space by default) from the start and end of string
Example: btrim('xyxtrimyyx', 'xy')
Result: trim


So you need to cast as text:

&find_condition=btrim(clients_corporate_billings.id::text,' ') %3D

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号