Appendix: Built-in Scripting Language strDBConn The name of the database connection. Connections are configured in the Database/ERP folder in the Project Explorer . strTable The name of the table in the database. strValues A string that lists the values to be written in the new row. This list of values should be comma-delimited, and string values must be enclosed in single quotes. optStrColumns A string that lists the columns into which the values will be written. This list of column names should be comma-delimited and in the same order as the values specified by strValues. This is an optional parameter.
If no columns are specified, then the values will be written in the default column order of the database table. optStrErrorTag The name of a String tag that will receive detailed error messages, if errors occur during runtime. Note: The tag name must be enclosed in quotes, as shown in the syntax diagram, or else the project will try to get the value of the named tag. This is an optional parameter. Returned value In case of error, returns a negative number. Otherwise, returns 1. Examples As used in a Math worksheet:
DBSelect DBSelect is a built-in scripting function that selects a result set from an external database (equivalent to a SQL SELECT statement), maps the columns to array tags in your project, and copies the values from the result set to the array tags. Syntax DBSelect( strDBConn , strTable , strTags , strColumns , strCondition , strOrder { | , optNumMaxRows { | , optStrErrorTag } } ) strDBConn The name of the database connection. Connections are configured in the Database/ERP folder in the Project Explorer . strTable The name of the database table from which you want to select.
strTags A comma-delimited list of the names of array tags in your project, to which the columns of the database table will be mapped. The database values will be copied to these array tags, with the first row of the result set being copied to array index 0. Make sure the arrays are large enough to receive all of the rows in the result set. Page 632 InduSoft Web Studio Tag Name Expression nErrorCode DBInsert( "DB1", "Table1", "1, 'one'", "Column1, Column2" ) Function Group Execution Windows Embedded Thin Client DBSelect Database/ERP Synchronous Supported Supported Supported