This article will cover the syntax of the ‘SQL’ regular script statement.
This statement is used to send a command through a database connection.
Statement syntax
SQL sql_command;
Sql_command | An SQL command that is valid considering the database syntax. In addition, the database connection can be created with limited permissions in which case some types of statements may not be permitted. |
Example
A select statement is used to load data from a Google Analytics database connection.
GA_DATA:
SQL SELECT
dim_pagePath,
metric_pageviews,
metric_uniquePageviews,
metric_sessionDuration,
metric_bounces,
metric_entrances,
metric_exits
FROM DataFromTemplateQuery
WITH PROPERTIES (
profileId='xyz',
prebuiltQuery='query_parameters'
);
Result
The data is loaded into a table ‘GA_DATA’.