On this Page
Table of Contents | ||||
---|---|---|---|---|
|
Snap type: | Read | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: | This Snap allows you to fetch data from a SQL Server database by providing a table name and configuring the connection. The Snap produces the records from the database on its output view which can then be processed by a downstream Snap.
| ||||||||||||
Prerequisites: | None | ||||||||||||
Support and limitations: |
| ||||||||||||
Account: | This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See Configuring SQL Server Accounts for information on setting up this type of account. | ||||||||||||
Views: |
| ||||||||||||
Settings | |||||||||||||
Label | Required. The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline. | ||||||||||||
Schema Name | The database schema name. In case it is not defined, then the suggestion for the Table Name will retrieve all tables names of all schemas. The property is suggestible and will retrieve available database schemas during suggest values. Example: SYS | ||||||||||||
Table Name | Required. The table to execute the select query on. Default value: [None] | ||||||||||||
Where clause | The where clause of a select statement. This supports document value substitution (such as $person.firstname will be substituted with the value found in the incoming document at the path). Examples:
| ||||||||||||
Order by | Enter in the columns in the order in which you want to order by. The default database sort order will be used. Example: name Default value: [None] | ||||||||||||
Limit offset | Starting row for the query. Example: 0 Default value: [None] | ||||||||||||
Limit rows | Number of rows to return from the query. Example: 10 Default value: [None] | ||||||||||||
Query Hints | Enter hints to customize and optimize the database engine in processing the query statement.
Example: OPTION (USE HINT ('DISABLE_OPTIMIZER_ROWGOAL')) Default value: [None] | ||||||||||||
Output fields | Enter or select output fields for SQL SELECT statement. To select all fields, leave it at default. Example: email, address, first, last, etc. Default value: [None] | ||||||||||||
Fetch Output Fields In Schema |
Default value: Not selected | ||||||||||||
Pass through | Select this checkbox to pass the input document to the output view under the key Default value: Selected | ||||||||||||
Ignore empty result | Select this checkbox if you do not want to write to the output view when a SELECT operation does not produce any result or is empty. If you do not select this property and selected the Pass through property, the input document is passed through to the output view. Default value: Not selected | ||||||||||||
Auto commit | Select one of the options for this property to override the state of the Auto commit property on the account. The Auto commit at the Snap-level has three values: True, False, and Use account setting. The expected functionality for these modes are:
Default value: False | ||||||||||||
Number of retries | Specifies the maximum number of attempts to be made to receive a response. The request is terminated if the attempts do not result in a response.
Example: 3 Default value: 0 | ||||||||||||
Retry interval (seconds) | Specifies the time interval between two successive retry requests. A retry happens only when the previous attempt resulted in an exception. Example: 10 Default value: 1 | ||||||||||||
Match data types | Conditional. This property applies only when the Output fields property is provided with any field value(s). If this property is selected, the Snap tries to match the output data types same as when the Output fields property is empty (SELECT * FROM ...). The output preview would be in the same format as the one when SELECT * FROM is implied and all the contents of the table are displayed. Default value: Not selected | ||||||||||||
Staging mode | Required when the value in the Number of retries field is greater than 0. Specify the location from the following options to store input documents between retries:
| ||||||||||||
Option for Unique Identifier Column | Conditional. This propery applies only when the Snap returns the unique identifier (GUID) in the output. The unique identifier is stored in the database using an internal format and when it is displayed in the output, it is converted to a string and gets displayed in upper case for HEX characters. Select either of the following options to change the case type. Available options are:
Default Value: Convert to lower case Example: Convert to upper case | ||||||||||||
Convert rowversion datatype to integer | Select this checkbox to display the Rowversion datatype as integers instead of the binary array in the Snap output. Default Value: Deselected | ||||||||||||
Snap Execution | Select one of the three modes in which the Snap executes. Available options are:
|
Examples
In this example, we will show how to retrieve data from a table called 'customer'.
We can pass the dynamic variable used in where clause from upstream Snap like JSON Generator. We try to retrieve customers by their name.
The sample output looks like below:
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|