Saving a binary file to a database with the Database Connectivity Toolset
Overview
These programs will allow you to save and retreive a binary file into a database. This is useful for things such as jpeg's or xls files.
Introduction
SQL databases can store many datatypes, but there are also many files that need to be saved as a binary that can only be read with an appropriate program. For example .xls files can be opened only with programs like Microsoft Excel, or OpenOffice.org, but not a text editor. These VIs implement a LabVIEW solution using the Database Connectivity Toolset to save these types of files and read them back from the database and open them in the associated program.
Database support
The datatype we are going to take advantage of is the BLOB. There are different BLOB datatypes that can accomodate different size files. A blob is a collection of binary data. Blobs are typically images, audio or other multimedia objects, though you can also store binary code a blob. Database support for blobs is not universal. So depending on your database you might not be able to implement this code.
The Microsoft ODBC driver for Oracle and the Microsoft OLE DB Provider for Oracle DO NOT support BLOB (binary) data types. You will not be able to use Oracle with the Database Connectivity Toolset for binary data with these drivers. The workaround is to use the OLE DB Provider (and ODBC driver) provided by Oracle from their web site at: http://technet/oracle.com/tech/nt/ole_db/.
Reader Comments | Submit a comment »
Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
