Db2

Db2

Where DBAs and data experts come together to stop operating and start innovating. Connect, share, and shape the AI era with us.


#Data


#Data
#Databases
#Operatingsystems
#Db2
#Databasesolutions
 View Only
  • 1.  How to Base64 Enode Column in SQL Statement?

    Posted 01/19/23 12:32 PM
    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 01/30/23 09:27 AM

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