•
identifies most image formats and file types automatically
•
export unlimited images and files on demand
•
command line interface allows you to automate your export tasks
•
supports Access, Firebird, MySQL, Oracle, PostgreSQL, SQL Server,
SQL Server Compact, SQLite, and ODBC data sources
View and export images and
files from your database using
SQL Image Viewer
Products
Support
Get our Products
Copyright © 2005 - 2017 Yohz Software, a division of Yohz Ventures Sdn Bhd. ALL RIGHTS RESERVED.
All trademarks or registered trademarks are property of their respective owners
Company
The SQL Image Viewer Professional Edition license includes a command line interface (SQLImageViewerCmd.exe) you
can use to automate your export tasks. Please see this page on how to set up an automated export task using the
Windows Task Scheduler.
Most of the time, you would want your automated task to export only new items. SQL Image Viewer can do this in a
few ways
Option 1: use the SQL command from a file
You may use another program to generate the SQL command to run, store the command in a file, and have SQL
Image Viewer use the command in that file when it runs the export. You do this by modifying the SQL Image
Viewer export settings file. By default, the SQL command it runs is the same one used when you set up the
export in the GUI, and is stored in the SQLQuery parameter:
How to to export only new files and images in your scheduled export tasks
(Professional Edition required)
To use the SQL command from a file, change the SQLQuery value to the file name e.g.
Option 2: provide a list of values from a file
Again, you may use another program to generate a list of values that SQL Image Viewer should use as a reference
to export the new items. For e.g. your query may look something like this:
This tells SQL Image Viewer to open the file f:\exports\IDList.txt and use the integer values in that file as part of
the query. In the IDList.txt file, each line should contain only a single value e.g.
During the export, the SQL command that is used will be:
SELECT * FROM Production.ProductPhoto WHERE ID IN (1010, 1020, 1030, 1040, 1050,
1060, 1070, 1080, 1090, 1100, 1110, 1120)
You can also use a list of text values. In this case, use the stringlist keyword instead of integerlist e.g.
In the file, each line should only contain one value, and need not be enclosed in quotes e.g.
During the export, the SQL command that is used will be:
SELECT * FROM Production.ProductPhoto WHERE ID IN (’A10’, ‘A99’, ‘B102’, ‘B105’)
Option 3: use a key value that identifies new items
You can use a key value in your query to export only new items. Say that you have a table that contains binary
data, where the ID value is a primary key, only new binary data are added, and existing binary data are never
modified. You could then use the following base query:
Like in option 2 above, SQL Image Viewer will use the value in the f:\exports\LastID.txt file in the query. It is also
important to note that the results are sorted by the ID value (ORDER BY ID).
To make SQL Image Viewer store the last ID value for each export, we need to add a StoredValue section in the
settings file e.g.
In the example above, we created a section named StoredValue1. You can have multiple StoredValue sections,
but they must be numbered sequentially.
In the StoredValue1 section, we want to store the value of the ID column for the last exported row in the
f:\exports\LastID.txt file. We do this by setting the column value to ID:
and setting the filename value to f:\exports\LastID.txt.
On the first run, you will need to create the f:\exports\LastID.txt file manually, and enter a value you want the
export to start off with. After that, SQL Image Viewer will automatically update this file with the last ID value for
each of its export run.
A summary of the steps is as follows:
o
modify the SQLQuery parameter in the settings file to use values from an external file, using the integerlist
option
o
ensure that your query is sorted by an ascending key value
o
create a StoredValue section in your settings file, and enter the column and filename parameters
o
create the stored value file manually, and enter an initial value to start the first export with