An answer constructed from comments:
What are you expecting in the flat files? uniqueidentifier is a 16-byte GUID, so in its native format it's just a series of raw bytes. (Which would be mapped to CHAR(16) FOR BIT DATA in DB2). – Ian Bjorhovde Jan 20 '16 at 20:32
As mentioned, a GUID is just a 16-byte value (you could think of it as a 128-bit number if ...
A note in the manual explains why these statements do not make it into the audit log:
The preparation of a statement is not considered part of the execution. Most authorization checks are performed at prepare time (for example, SELECT privilege). This means that statements that fail during prepare due to authorization errors do not generate EXECUTE events....
As is suggested in the comments, you should change the data type to, for example, char(3). If that is not possible, you can transform the value of the column like:
SELECT SUBSTR(DIGITS(CURRENCY_CODE),1,3) AS CURRENCY_CODE
SELECT DIGITS(CAST(CURRENCY_CODE AS DECIMAL(3,0))) AS CURRENCY_CODE
which would be the same as:
A bit late to the party, but I had a recent project where I needed to accomplish something similar with a simpler solution and thought I should share this approach using XMLTABLE instead of recursive SQL.
Data setup is the same as in Jeff Rudnick's answer.
DECLARE GLOBAL TEMPORARY TABLE session.sample_data (
The problem is that the database must be encoded in UTF-8.
JSON data consists of a sequence of Unicode characters that are arranged in a hierarchical form based on the JSON value syntax and grammar