Search code examples
informix

String concatenation within INFORMIX-SQL "Perform" screens


How can I concatenate two char columns within a perform screen?

example:

table sample
col1 char(1)
col2 char(1)

after edit/add of sample

let label_3 = sample.col1 + sample.col2

.. this didn't work, I even tried using subscripts for the 2 cols but no dice!


Solution

  • There isn't a simple way to do it. Your closest approach would be a custom C function to do the concatenation:

    LET label_3 = CONCATENATE(sample.col1, sample.col2)
    

    That, of course, relies on you having a custom Perform runner with a concatenate function added to it.

    Perform pre-dates the addition of the '||' string concatenation operator into SQL and does not support it.

    The alternative is to use an Informix 4GL (I4GL) program instead. You can do a lot of things in I4GL that you cannot do in ISQL - at the cost of writing the code.