ODBC Query
Back to
Related topics
Looking for Winshuttle Composer Plugins?
The ODBC Query plug-in allows you to work with SQL databases by creating, updating, and deleting database records.
Value Pair | Description |
connectionstring | String to use to connect to the database. Note:
|
escapesql | A Yes/No value that indicates whether or not the plug-ins should escape apostrophes in the field values used in substitutions in the query supplied. The default is Yes if omitted. |
query | Query to run on the database with the form data. |
Example 1: Insert a Record
- connectionstring – DRIVER={SQL Server};SERVER=localhost;DATABASE=ws;UID=svdb;PWD=ws;OPTION=3
- query – set quoted_identifier off; insert into EnvironmentalLog (ID, EquipName, ScrubFlow, PressDrop, Comments) values ("[formId]", "[EquipName]", "[ScrubFlow]", "[PressDrop]", "[Comments]")
Example 2: Update a Record
- connectionstring – DRIVER={SQL Server};SERVER=localhost;DATABASE=ws;UID=svdb;PWD=ws;OPTION=3
- query – set quoted_identifier off; update EnvironmentalLog set EquipName = "[EquipName]" where ID = "[//my:titleNum]" update EnvironmentalLog set PressDrop = "[PressDrop]" where ID = "[//my:titleNum]" update EnvironmentalLog set distComments = "[Comments]" where ID = "[//my:titleNum]"
Example 3: Delete a Record
- connectionstring – DRIVER={SQL Server};SERVER=localhost;DATABASE=ws;UID=svdb;PWD=ws;OPTION=3
- query – set quoted_identifier off; delete fromEnvironmentalLog where ID = "[//my:titleNum]"