Monday, 25 November 2024

BASE 64 in Oracle APPS R12

 In computer programming, Base64 is a group of binary-to-text encoding schemes that transforms binary data into a sequence of printable characters, limited to a set of 64 unique characters. 

CREATE TABLE xx_blob_base64
  (
     xid   NUMBER,
     xfile BLOB
  ); 

Upload a PDF file over XFILE column of table 'xx_blob_base64':

Function to convert BLOB to BASE64:

CREATE FUNCTION Xx_getbase64(p_source BLOBRETURN CLOB IS
  v_result CLOB;
BEGIN
    dbms_lob.Createtemporary(lob_loc => v_result, CACHE => FALSE, dur => 0);

    wf_mail_util.Encodeblob (p_source, v_result);

    RETURN ( v_result );
END xx_getbase64; 

Now, get the BASE64 :

SELECT Xx_getbase64(xfile)
FROM   xxcns_blob_base64; 


Save this data into TEXT file.

Can use any decode tool (For Ex, online tool https://base64.guru/converter/decode/file) to decode this file into PDF.


No comments:

Post a Comment