Search code examples
sqlinformaticainformatica-powercenter

Dynamic operators in where clause in Informatica


Is it possible to create dynamic sql operator in Informatica using SQL Transformation. For eg.

SELECT p.id 
FROM products p
WHERE p.weight ?operator? '30'

where ?operator? can have values: <, > , =

or even: in, not in


Solution

  • The SQL Editor window of SQL Transform allows to use parameter binding (?parameter?) and string substitution (~string~). You need the latter:

    SELECT p.id 
    FROM products p
    WHERE p.weight ~operator~ '30'
    

    This topic is described well in SQL Transformation > Query Mode chapter of the Transformation Guide.