Full support of BLOB in ORDA

Automatically translated from English

Many of you have already taken the leap and started using ORDA. To ease your coding experience, we are glad to announce that Blobs are now fully supported in ORDA, like any other type. After the first step in 4D v19 R2, with the support of the Blobs in objects, 4D v19 R3 brings the support of Blobs in ORDA.

Save a Blob in the database

You can now use the ORDA syntax to save a Blob in a database. For example, if you want to archive emails in your database:

$IMAPTransporter:=4D.IMAPTransporter.new($parameters)
$blob:=$IMAPTransporter.getMIMEAsBlob()
// Saves the blob in the EmailArchives table
$archive:=ds.EmailArchives.new()
$archive.Date:=Timestamp
$archive.Blob:=$blob
$archive.save()

read a Blob in the database

In the same way, you can use the ORDA syntax to get the contents of a Blob saved in the database. For example, if you want to retrieve an email in your database:

$archive:=ds.EmailArchives.get($id)
$email:=MAIL Convert from MIME($archive.Blob)

Obviously, if your table is encrypted, ORDA manages for you the encryption/decryption of your Blobs.

As usual with Blob fields, keep in mind that a Blob can’t exceed 2GB! For more information, take a look at the documentation.

Fabrice Mainguené

• Product Owner •

Fabrice Mainguené joined 4D Program team in November, 2016. As a Product Owner, he is in charge of writing the user stories then translating it to functional specifications. His role is also to make sure that the feature implementation delivered is meeting the customer need.

After obtaining a Bachelor degree in Computer Science at CNAM, Fabrice joined a small software publishing company as a Windev developer. Then he worked for different companies in industry and trade areas as a Windev and web developer as well as technical advisor on new features.