Convert Blob to Clob for Oracle DB storage

0
Hi Is there a way to convert a Blob from Base64EncodeFile to a clob that can be stored in a oracle database? Thanks
asked
3 answers
1

Since a base64encoded string is a character based datatype, you can save this in a clob directly.

answered
1

I am still not sure what you are trying to achieve. Assuming that you are connecting to an external oracle database and not trying to store this in the Mendix internal database. And assuming you have a Mendix FileDocument containing the data you want to store in a clob in this external database:

An option is to create a java action. Some pieces of the puzzle:

On transforming a FileDocument to an input stream: https://docs.mendix.com/howto/logic-business-rules/java-api-tutorial

On creating a prepared statement to insert a blob: https://docs.oracle.com/javase/tutorial/jdbc/basics/blob.html

I hope this helps.

answered
0

Hi all, thanks Michiel and Lennart. We finaly saved the object into a Clob field in the Oracle. 

 

answered