DatabaseLink`
DatabaseLink`

SQLBinary

SQLBinary[data]

represents raw binary data that can be stored in a database.

Details

Examples

Basic Examples  (1)

In[1]:=
Click for copyable input

If you find that the examples in this section do not work as shown, you may need to install or restore the example database with the "DatabaseLink`DatabaseExamples`" package, as described in Using the Example Databases.

Open a connection:

In[2]:=
Click for copyable input
Out[2]=

Create a table with a column to store binary data:

In[3]:=
Click for copyable input

Generate an image:

In[4]:=
Click for copyable input
Out[4]=

Represent the image as a string in GIF format:

In[5]:=
Click for copyable input

Display the first few characters of the string:

In[6]:=
Click for copyable input
Out[6]=

Convert the string into a list of bytes wrapped in SQLBinary:

In[7]:=
Click for copyable input

Insert the data:

In[8]:=
Click for copyable input

Retrieve the data:

In[9]:=
Click for copyable input

Convert the data back into a string:

In[10]:=
Click for copyable input

Display the imported image:

In[11]:=
Click for copyable input
Out[11]=
In[12]:=
Click for copyable input
In[13]:=
Click for copyable input

See Also

SQLDateTime  SQLExpr

Tutorials