18.01.2015 Views

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Appendix: Built-in Scripting Language<br />

Please note this is the value returned by the function itself; in the case of a SQL SELECT statement, the<br />

database values are copied to the array tags specified by optStrTags.<br />

Notes<br />

This feature emulates SQL (Structured Query Language) database operations. You should be familiar with<br />

how SQL statements are formed and executed before you use this feature.<br />

Examples<br />

DBExecute( "DB1", "INSERT INTO Table1(Column1,Column2) values(1,1)" )<br />

DBExecute( "DB1", "SELECT max(Column1),max(Column2) FROM Table1", "Tag1,Tag2", 1,<br />

"TagError" )<br />

DBInsert<br />

Inserts one new row into a database table. (This function is equivalent to a SQL INSERT statement.)<br />

Function Group Execution Windows Embedded Thin Client<br />

DBInsert Database/ERP Synchronous Supported Supported Supported<br />

Note: This feature emulates SQL (Structured Query Language) database operations. You should be<br />

familiar with how SQL commands are formed and executed before you use this feature.<br />

Syntax<br />

DBInsert( strDBConn, strTable, strValues, optStrColumns, "optStrErrorTag" )<br />

strDBConn<br />

strTable<br />

strValues<br />

The name of the database connection. Connections are configured in the Database/ERP folder in<br />

the Project Explorer.<br />

The name of the table in the database.<br />

A string that lists the values to be written in the new row. This list of values should be commadelimited,<br />

and string values must be enclosed in single quotes.<br />

optStrColumns<br />

A string that lists the columns into which the values will be written. This list of column names<br />

should be comma-delimited and in the same order as the values specified by strValues.<br />

This is an optional parameter. If no columns are specified, then the values will be written in the<br />

default column order of the database table.<br />

optStrErrorTag<br />

The name of a String tag that will receive detailed error messages, if errors occur during<br />

runtime.<br />

Note: The tag name must be enclosed in quotes, as shown in the syntax<br />

diagram, or else the project will try to get the value of the named tag.<br />

This is an optional parameter.<br />

Page 750<br />

<strong>InduSoft</strong> Web Studio

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!