Element Details: Execute.SQL
 Back


Available in: Logi Info Source code name: Execute.SQL

Runs a SQL command such as INSERT, UPDATE, DELETE, or EXECUTE.

Set the Type attribute to "FirstRow" to access the first row of returned data. Each value will be stored in an ETL token by column name.

For Example:
@Etl.myExecuteID.myColumnName~

Set the Type attribute to "RowsAffected" to access the number of rows affect by the command. The value will be stored in the ETL token rdRowsAffected.

For Example:
@Etl.myExecuteID.rdRowsAffected~



ATTRIBUTES

Click attribute Name to drill down for more information.

NamePossible ValuesDescription
ConnectionID
UserDefined
Specifies a connection to a data source that is defined in the Settings. For elements connecting to relational databases, default is the first Connection element in _settings.lgx.
HandleQuotesInTokens
True
False
Handle Quotes in Tokens makes it possible to work with tokens, such as @Request tokens, that contain single quotes in their values. When set to True, any tokens in the Source attribute will have single quotes "doubled" so that they work within the SQL statement. For example, imagine a SQL statement in a Source attribute like "SELECT * FROM Customers WHERE CompanyName LIKE '@Request.Name~%' ". Then, if the Name we are searching for is "Trail's Head", the SQL executed becomes "SELECT * FROM Customers WHERE CompanyName LIKE 'Trail''s Head%' ". The default for Handle Quotes in Tokens is False.
ID
UserDefined
(Required) The ID attribute is a pervasive attribute that uniquely identifies an element within a definition file. The ID needs to be a unique value within the definition.
SqlCommand
UserDefined
(Required) A SQL command to be executed, usually beginning with INSERT, UPDATE, or DELETE. SQL commands do not return any rows.
SqlReturnType
RowsAffected
FirstRow
Sets the return type for a Procedure.SQL element. "RowsAffected" is useful for determining the number of rows changed by the SQL command. The supported SQL commands are UPDATE, INSERT, and DELETE. Access this value with an @Procedure "RowsAffected" token, for example: @Procedure.myProcedureId.RowsAffected~ "FirstRow" returns the first row of a rowset returned by the SQL command. Access the values of the first row with @Procedure tokens. For example: @Procedure.myProcedureId.someColumnName~ "RowsAffected" is the default value for SqlReturnType.



PARENT ELEMENTS

Click element to drill down for more information.

Etl Job
If
If ETL Error
If File Exists
If Folder Exists Loop.Data Layer Rows


CHILD ELEMENTS

Click element to drill down for more information.

If ETL Error


 Back to top