omron — SQL Connection to Sysmac NJ and IBM DB2 Quick Start Guide

To Select Data from the database: The DB_Select instruction does this for us. I works mostly the same as DB_Insert with two major differences. The MapVar can be an array. (Notice there is not “[0]” at the end of the variable name when it is an array. There is a “Where” input to filter which records you are looking for. (There is also a sort input). There are two counters at the bottom right corner of the instruction to tell you how many records it found and how many it gave to you (if your array was to small it just gives you enough to fill the array.) Notes on how to use the “Where” are below. The SQL Language uses ‘ ‘ in their syntax.

To let Sysmac Studio the ‘ is for the database put a $’. So the following first example means: BARCODE LIKE ‘B%’ to SQL. The % is a wildcard to SQL when the “LIKE” is included. Page 14 of 21