VI SQL Output Object
The Visual Integrator (VI) SQL output object writes data out to an ODBC-accessaible database. The specified SQL table or view must exist and not be locked by another process.
The SQL output object has three panes where you set attributes.
You set attributes for the SQL output object in the object attributes pane.
Attribute | Description |
---|---|
Input |
Defines the object from which the data flow arrives. Use one of the following methods to attach the SQL output object to an input data flow object:
|
Sql_Source |
Specifies the SQL data source from the list. If no data sources appear in the Sql_Source list, click <Refresh datasources>. VI creates one connection for each query or input object. There is no pooling. Do not use the Connect_String or the Connect_File attributes when using the Sql_Source attribute because they are mutually exclusive. |
Sql_Owner | Specifies the SQL owner if the Sql_Table attribute is set. If no names appear in the Sql_Owner list, click <Refresh schemas>. |
Sql_Table |
Specifies an SQL table or view name by selecting it from the list. If no names appear in the Sql_Table list, click <Refresh tables>. All columns in the specified table or view are selected when you use the Sql_Table attribute. |
Sql_Qualifier | Specifies the SQL qualifier when connecting to a Windows ODBC source. Click the browse button in the Sql_Table box, and browse to the file. |
Connect_String |
Specifies the ODBC connection string. VI creates one connection for each query or input object. There is no pooling. Do not use the Sql_Source or the Connect_File attributes when using the Connect_String attribute because they are mutually exclusive. |
Connect_File |
Specifies an obfuscated file that contains the connect string. This method of specifying the connect string is used to hide the SQL username and password from casual access. Click the browse button that appears after you click inside the field and navigate to the file. Do not use the Sql_Source or the Connect_String attributes when using the Connect_File attribute because they are mutually exclusive. To create the connect file, you use the command-line Integrator: integ -save_connect_file sql-server.cfile See -save_connect_file command in Integrator from the Command Line. |
Username | Specifies the username to log on to the ODBC data source. Type directly in the Username box, or click the browse button that appears to open the Enter ODBC credentials dialog box where you can enter both the username and password. |
Password |
Specifies the password to log on to the ODBC data source. Type directly in the Password box, or click the browse button that appears to open the Enter ODBC credentials dialog box where you can enter both the username and password. NOTE: The Enter ODBC credentials dialog box has a Test button so you can ensure that the credentials successfully connect to the ODBC datasource. |
Default_Value |
Specifies what value is given for columns missing from the input flow.
|
Null_Value | Defines a string that indicates a null value for columns that allow nulls to be set. If a value matches this exact string, then a null will be stored instead of this string value. If this attribute is not set, blank strings will be used to indicate nulls. |
Allow_Missing_Columns |
Specifies whether all table columns must appear in the input flow.
|
Clear_Table |
Specifies whether to clear the table before saving data to it.
|
Bulk_Insert |
Specifies whether to send data to the SQL database as multiple insert statements.
Use of this attribute can be helpful if there are error messages such as ODBC driver requesting duplicate data for column <n> or No data at execution values pending in the logs. |
Encoding |
Defines the encoding for the output file(s). Values include:
UCS-2 and UTF-8 files can include a Byte Order Mark (BOM) at the beginning of the file to denote the file encoding. These file signatures are defined as follows:
File signatures are common for Unicode files on Windows operating systems. If the file input object reads multiple files, the signature of each file determines its encoding. If the encoding attribute is auto and no signature is found, the encoding is assumed to be latin1 if no other object in the task handles Unicode data and the VI file is not encoded as utf-8 (using the charset 1208 directive). Otherwise, the encoding is assumed to be utf-8. See also Integrator Unicode Data Support. |
Sql_Type (OS/400 only) |
Specifies the SQL type. If SYSTEM or SYS is selected, it uses system naming. |
Sql_LIbrary (OS/400 only) |
Specifies the OS/400 library for the DB2 database. If specified, it overrides the Sql_Owner attribute. |
Sql_Commit (OS/400 only) |
Specifies the commit behavior as rows are added to the output table. These values correspond to the commit types found in the IBM SQL Call-Level Interface book.
|
Connection_Status |
Specifies connection status:
|
Each object has an area where you can enter comments.
It is a DI best practice to enter a note for every object in a VI script. You can set a VI preference to give a warning for each object without a note.
The SQL ouput object column grid displays the input data flow.
Attribute | Description |
---|---|
Input Column | Displays the name of each input column. This attribute is read-only. |
Source Object | Displays the name and object type of the source object. Double-click the Source Object for a column to change the task flow focus to that object. |