CONTACT US

568-3-53 (3rd Floor) Kompleks Mutiara 3 1/2 Mile, Jalan Ipoh 51200 Kuala Lumpur, Malaysia 6012-9714904 support@yohz.com https://www.yohz.com

RESOURCES

product blogs video tutorials help files
Copyright © 2005 - 2021 Yohz Software, a division of Yohz Ventures Sdn Bhd. ALL RIGHTS RESERVED. All trademarks or registered trademarks are property of their respective owners
How to to export only new files and images in your scheduled export tasks - Professional Edition required 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. When you set up the export settings in the GUI, the same query will be ran each time, and most likely the same data set(s) will be returned. SQL Image Viewer supports dynamic queries, where the SQL statement can be modified at run time. Let's use the following query as a starting point. Option 1 - provide a file that contains a SQL query You do this using the <file> tag. Instead of explicitly providing the SQL command to run, you can provide the name of a file that contains the SQL command to use. You can use this option when you have other applications that can dynamically generate the SQL command to use. Note that the query needs to contain any columns that you may have used to name the exported files. E.g. if your SQL command is stored in the f:\export\sql.txt file, you would modify the SQL to this: Option 2 - provide a list of integer values from a file You do this using the <integerlist> tag. Say that you only want to export items with specific ProductPhotoID values, and another application will provide this list of values. The requirement is that the application provides one value per line e.g. 56 75 89 and stores this list in a file. For our example, let's assume the list is stored in the f:\export\list.txt file. You would then need to modify your SQL to the following: When SQL ImageViewer runs the export, the SQL query it will run will contain the values from the file i.e. SELECT ProductPhotoID, LargePhoto FROM Production.ProductPhoto WHERE ProductPhotoID IN (56, 75, 89) To use a list of text values, use the <stringlist> tag e.g. Note that each text value in the file need not be enclosed in single quotes. Option 3 - use self-incrementing values In situations where you have a column that auto-increments each time, and you only need to export new items, the SQL Image Viewer command line interface can maintain a file that contains the last processed value for you. That file can then be used as input to the SQL command. Assuming that ProductPhotoID is a self-incrementing value in our example. Say we only want to export new items each time the export runs. First, we need to modify the query to use the <integerlist> tag, to point to a file that will hold the last ProductPhotoID value. We also need to ensure that our data set is ordered, so that the last record holds the latest ProductPhotoID value. Next, we need to tell SQL Image Viewer that we want to store the last ProductPhotoID value in the f:\export\LastID.txt file. We do this by entering the values in the Stored values area. Once you have saved your settings, you can test it by clicking on the Test settings button. SQL Image Viewer will run an export using the command line interface and the settings you have saved, and display the output.
View and export images and files from your databases using SQL Image Viewer
identifies images and file types automatically identify images and files stored in OLE Object columns export embedded images to Excel spreadsheets supports Access, MySQL, MariaDB, Oracle, PostgreSQL, SQL Server, SQL Server Compact, SQLite, and ODBC data sources
DOWNLOAD NOW
Get started with SQL Image Viewer Work with blobs faster - try SQL Image Viewer free for 14 days
Got a question? If you need help, or have any questions about SQL Image Viewer, please get in touch. support@yohz.com
Download trial Download trial Buy now, from USD 45 Buy now, from USD 45 See help file See help file

CONTACT US

568-3-53 (3rd Floor), Kompleks Mutiara, 3 1/2 Mile, Jalan Ipoh 51200 Kuala Lumpur, Malaysia 6012 9714904 support@yohz.com https://www.yohz.com

RESOURCES

product blogs video tutorials help files
Copyright © 2005 - 2021 Yohz Software, a division of Yohz Ventures Sdn Bhd. ALL RIGHTS RESERVED. All trademarks or registered trademarks are property of their respective owners
View and export images and files from your databases using SQL Image Viewer
identifies images and file types automatically identify images and files stored in OLE Object columns export embedded images to Excel spreadsheets supports Access, MySQL, MariaDB, Oracle, PostgreSQL, SQL Server, SQL Server Compact, SQLite, and ODBC data sources
Download trial Download trial See help file See help file Buy now, from USD 45 Buy now, from USD 45
How to to export only new files and images in your scheduled export tasks - Professional Edition required 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. When you set up the export settings in the GUI, the same query will be ran each time, and most likely the same data set(s) will be returned. SQL Image Viewer supports dynamic queries, where the SQL statement can be modified at run time. Let's use the following query as a starting point. Option 1 - provide a file that contains a SQL query You do this using the <file> tag. Instead of explicitly providing the SQL command to run, you can provide the name of a file that contains the SQL command to use. You can use this option when you have other applications that can dynamically generate the SQL command to use. Note that the query needs to contain any columns that you may have used to name the exported files. E.g. if your SQL command is stored in the f:\export\sql.txt file, you would modify the SQL to this: Option 2 - provide a list of integer values from a file You do this using the <integerlist> tag. Say that you only want to export items with specific ProductPhotoID values, and another application will provide this list of values. The requirement is that the application provides one value per line e.g. 56 75 89 and stores this list in a file. For our example, let's assume the list is stored in the f:\export\list.txt file. You would then need to modify your SQL to the following: When SQL ImageViewer runs the export, the SQL query it will run will contain the values from the file i.e. SELECT ProductPhotoID, LargePhoto FROM Production.ProductPhoto WHERE ProductPhotoID IN (56, 75, 89) To use a list of text values, use the <stringlist> tag e.g. Note that each text value in the file need not be enclosed in single quotes. Option 3 - use self-incrementing values In situations where you have a column that auto-increments each time, and you only need to export new items, the SQL Image Viewer command line interface can maintain a file that contains the last processed value for you. That file can then be used as input to the SQL command. Assuming that ProductPhotoID is a self-incrementing value in our example. Say we only want to export new items each time the export runs. First, we need to modify the query to use the <integerlist> tag, to point to a file that will hold the last ProductPhotoID value. We also need to ensure that our data set is ordered, so that the last record holds the latest ProductPhotoID value. Next, we need to tell SQL Image Viewer that we want to store the last ProductPhotoID value in the f:\export\LastID.txt file. We do this by entering the values in the Stored values area. Once you have saved your settings, you can test it by clicking on the Test settings button. SQL Image Viewer will run an export using the command line interface and the settings you have saved, and display the output.