Yes, you can query a column and return it as a BASE64 encoded value using the SELECT statement with the BASE64ENCODE function. The syntax you provided is correct, and it would look like this:
SELECT BASE64ENCODE(column) AS Base64Encoded FROM table;
Please note that the BASE64ENCODE function is not a standard SQL function, it may not be supported by DB2(z/OS) or any other DBMS. However, you can use similar function to achieve this or use some external library to get the base64 encoded value of the column.
------------------------------
Uma Sajit
------------------------------
Original Message:
Sent: Thu January 19, 2023 12:31 PM
From: Kurt Shull
Subject: How to Base64 Enode Column in SQL Statement?
I have a column in a table that's I'd like to query and return as BASE64Encoded. Is there a way to do this?
SELECT BASE64ENCODE(column) AS Base64Encoded
FROM table;
I'm a newbie to DB2(z/OS).
------------------------------
Kurt Shull
------------------------------