App Connect

 View Only
  • 1.  IIB/ACE Trace Node - how to format output values in double quotes?

    Posted Wed March 03, 2021 03:25 PM

    https://www.ibm.com/support/knowledgecenter/SSTTDS_11.0.0/com.ibm.etools.mft.doc/ac04840_.html

    Hi
    I have got a trace node, destination file, with a pattern similar to the sample

    Message passed through with the following fields:
    Store name is ${Body.storedetailselement.storename}
    Total sales are ${Body.totalselement.totalsales}
    Time is: ${EXTRACT(HOUR FROM CURRENT_TIMESTAMP)}:${EXTRACT(MINUTE FROM CURRENT_TIMESTAMP)}
    Message passed through with the following fields:
    Store name is 'SRUCorporation' Total sales are '34.98' Time is: 11:19

    Is it possible to output the values in double quotes?

    The current working solution feels like a bug
    "${REPLACE(LocalEnvironment.TimeoutRequest.StartDate,'','')}"



    ------------------------------
    Matthias Jungbauer
    ------------------------------


  • 2.  RE: IIB/ACE Trace Node - how to format output values in double quotes?

    Posted Wed March 10, 2021 05:07 AM
    Hi Matthias.
    I tried this now, both examples below works - I had an integer in my Environment.SQL.Result.count field:
    Total sales are ''${CAST(Environment.SQL.Result.count AS CHAR)}''
    Total sales are "${CAST(Environment.SQL.Result.count AS CHAR)}"​

    It produced the following output:

    Total sales are ''8''
    Total sales are "8"

    Cheers,
    Lars

    ------------------------------
    Lars Dehli
    ------------------------------



  • 3.  RE: IIB/ACE Trace Node - how to format output values in double quotes?

    Posted Thu March 11, 2021 11:08 AM
    Thanks

    ------------------------------
    Matthias Jungbauer
    ------------------------------



  • 4.  RE: IIB/ACE Trace Node - how to format output values in double quotes?

    IBM Champion
    Posted Wed March 24, 2021 04:28 PM
    On a vaguely similar tangent I have this ESQL passthru statement.

    SET Emp.EmpRecord[] = PASSTHRU('SELECT * FROM EMPLOYEE WHERE EMPNO='||''''||EmpID||'''');

    I got this from a Youtuber. I am struggling to find documentation to help me understand how the single quotes work. Could you point me in the right direction?

    ------------------------------
    Amit Kapila
    Integration Developer
    eComm Europe Limited
    London
    UK
    amitkapila@hotmail.com
    +44 (0)2085707240
    +44 (0)7976529902
    ------------------------------



  • 5.  RE: IIB/ACE Trace Node - how to format output values in double quotes?

    Posted Thu March 25, 2021 03:53 AM
    Hi!
    I would recommend you to parametrize the query. Something like:
    DECLARE query CHAR 'SELECT * FROM EMPLOYEE WHERE EMPNO=?';
    SET Emp.EmpRecord[] = PASSTHRU(query, EmpID);

    I have seen strange problems when not using parameters (specially if you have a CHAR with special characters), and I also believe I've read that it is slightly faster, not sure if that's correct though.


    ------------------------------
    Lars Dehli
    ------------------------------



  • 6.  RE: IIB/ACE Trace Node - how to format output values in double quotes?

    IBM Champion
    Posted Thu March 25, 2021 03:04 PM
    Thank you for making me aware of the advantages to using a parameterised approach. I was originally using parameters but was not aware of the efficiency advantages or that it negates the possibility of erroneous errors.

    So there really is no need to go through the pain of working out how to place the quote characters as I did.

    To reiterate I have found a working example of the complex method for the more inquisitive developer:

    SET Emp.EmpRecord[] = PASSTHRU('SELECT * FROM EMPLOYEE WHERE EMPNO='||''''||EmpID||'''');

    Amit

    ------------------------------
    Amit Kapila
    Integration Developer
    eComm Europe Limited
    London
    UK
    amitkapila@hotmail.com
    +44 (0)2085707240
    +44 (0)7976529902
    ------------------------------