Dismiss Notice
We would like to remind you that we’re updating our login process for all 3CX forums whereby you will be able to login with the same credentials you use for the Partner or Customer Portal. Click here to read more.

Problems with CONCENATE operator in VAD

Discussion in 'CRM / Helpdesk / App Integration' started by jorlovs, Oct 10, 2012.

Thread Status:
Not open for further replies.
  1. jorlovs

    Joined:
    Oct 10, 2012
    Messages:
    1
    Likes Received:
    0
    Hello,

    I have situation where I need to create VAD project for telephone number lookup in the 3CX callhistory table. Problem starts in the moment when we call to customer with the call format 0XXXXXX, but when customer calls us he calls with the format XXXXXX.

    So to mach caller we need to caller XXXXXX number add 0 to make in SQL query.

    So I'm tryning CONCENATE operator in expression:

    CONCATENATE('0',RIGHT(session.ani,6)), but when created this it goes out with the error:

    ERROR [42883] ERROR: operator does not exist: character varying = integer; Error while executing the query

    In other case, if
     
  2. VAD_Support

    VAD_Support Active Member

    Joined:
    Aug 6, 2009
    Messages:
    690
    Likes Received:
    0
    How are you configuring your SQL query into your Database Access component?

    If the database field is a varchar, when you compare you need to add quotes. For example:

    SELECT * FROM table WHERE field_name = '{0}'

    And then configure your first parameter with the expression you mentioned:
    CONCATENATE('0',RIGHT(session.ani,6))

    This is because the expression result will be put into the SQL query without quotes, so you need to add quotes to your SQL query to make the field a varchar.
     
Thread Status:
Not open for further replies.