locked
Mapping Data Flow - Escaping single quote RRS feed

  • Question

  • Hi,

    Is it possible to add a single qoute to a string in Expression Builder in Mapping Data Flows? 

    I want to combine a parameter with a sql question in order to get it dynamic but are not able to get it to work. The Expression builder dosen't buy the expression below.

    Expression:

    concat('select count(*) Count from table where Filename=''', $File_Name, '''')

    Desired result:

    select count(*) Count from table where Filename = 'file1.csv'

    Any one have an idea?

    Thanks.

    //AL_T

    Monday, November 18, 2019 8:40 AM

Answers

  • Don't need concat(). Just use plus + sign and escape the literal single quote '

    'select count(*) Count from table where Filename = \'' + $File_Name + '\''

    • Marked as answer by AL_T Monday, November 18, 2019 9:27 AM
    Monday, November 18, 2019 9:00 AM

All replies

  • Don't need concat(). Just use plus + sign and escape the literal single quote '

    'select count(*) Count from table where Filename = \'' + $File_Name + '\''

    • Marked as answer by AL_T Monday, November 18, 2019 9:27 AM
    Monday, November 18, 2019 9:00 AM
  • Thank you very much mkro!

    It works perfect.

    //AL_T


    Monday, November 18, 2019 9:28 AM