Db2

 View Only
  • 1.  How to Base64 Enode Column in SQL Statement?

    Posted 18 days ago
    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
    ------------------------------


  • 2.  RE: How to Base64 Enode Column in SQL Statement?

    Posted 7 days ago

    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
    ------------------------------