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
------------------------------
Original Message:
Sent: Thu March 25, 2021 03:53 AM
From: Lars Dehli
Subject: IIB/ACE Trace Node - how to format output values in double quotes?
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
Original Message:
Sent: Wed March 24, 2021 04:28 PM
From: Amit Kapila
Subject: IIB/ACE Trace Node - how to format output values in double quotes?
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
Original Message:
Sent: Wed March 10, 2021 05:06 AM
From: Lars Dehli
Subject: IIB/ACE Trace Node - how to format output values in double quotes?
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
Original Message:
Sent: Wed March 03, 2021 03:24 PM
From: Matthias Jungbauer
Subject: IIB/ACE Trace Node - how to format output values in double quotes?
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
------------------------------