MuleSoft Connector for YouTube Analytics

Build 21.0.7930

Stored Procedures

The following sections show how to build stored procedure calls in the Visual Editor or with XML.

Configuration in the Visual Editor

To configure stored procedure operations in the Visual Editor, select the connector inside your flow and specify the following connector properties:

  • Connector Configuration: Select a connection you created. See Establishing a Connection for more information.
  • Operation: Choose Stored Procedure.
  • Parameter type: By default, the connector executes parameterized queries. Choose the Dynamic query type to override this. See Parameterized Queries for more information on parameterized queries.
  • SQL query: Enter the stored procedure name or use the CALL syntax.

    The CALL syntax refers to the parameters sequentially.

    { call RefreshOAuthAccessToken ('OAuthAccessToken', ... ) }

    Below is a parameterized CALL:

    { call RefreshOAuthAccessToken (?,?, ... ) }

To specify parameters, click the Add Parameter button in the Parameters section and configure the necessary fields.

  • Name: Defines the parameter name. To use named parameters, invoke the stored procedure by name. A prefix for the named parameter is not needed.

    Anonymous parameters are passed to the stored procedure sequentially.

  • IN/OUT: Defines the parameter direction: IN for input parameters (the default), OUT for output parameters, or IN/OUT for parameters that can be both set in the input and returned in the output.
  • Type: Defines the JDBC data type. The default is VARCHAR.

XML Editor

To configure stored procedure calls from code, add the <cdata-youtubeanalytics:stored-procedure> element. You can configure the call with the following fields:

  • config-ref: References a connection you created. See Establishing a Connection for more information.
  • query: Specifies the stored procedure name or use the CALL syntax.

    The CALL syntax refers to the parameters sequentially.

    { call RefreshOAuthAccessToken ('OAuthAccessToken', ... ) }

    Below is a parameterized CALL, which references parameters anonymously with "?":

    { call RefreshOAuthAccessToken (?,?, ... ) }

  • queryType: Set this to "Dynamic" or "Parameterized", the default value.
  • fetchSize: Set this to configure the paging of results returned. See Querying Data for more information on paging.

To configure a parameter, you can define the following attributes in <cdata-youtubeanalytics:parameter>:

  • name: Defines the parameter name. To use named parameters, invoke the stored procedure with the stored procedure name. Anonymous parameters are passed to the stored procedure in the order they are specified in the <cdata-youtubeanalytics:parameters> element.
  • direction: Defines the parameter direction: "in", "in/out", or "out".
  • type: Defines the JDBC data type. The default is VARCHAR.

The following configuration passes in named parameters:

<cdata-youtubeanalytics:stored-procedure config-ref="CData_YouTubeAnalytics_Configuration" doc:name="CData YouTubeAnalytics"  query="RefreshOAuthAccessToken" fetchSize="100">
<cdata-youtubeanalytics:parameters>
<cdata-youtubeanalytics:parameter name="OAuthAccessToken" value="OAuthAccessToken"/>
</cdata-youtubeanalytics:parameters>
</cdata-youtubeanalytics:stored-procedure>

The following configuration uses the CALL syntax to execute a parameterized stored procedure:

<cdata-youtubeanalytics:stored-procedure config-ref="CData_YouTubeAnalytics_Configuration" doc:name="CData YouTubeAnalytics"  query="{ call RefreshOAuthAccessToken (?)}" fetchSize="100">
<cdata-youtubeanalytics:parameters>
<cdata-youtubeanalytics:parameter value="OAuthAccessToken"/>
</cdata-youtubeanalytics:parameters>
</cdata-youtubeanalytics:stored-procedure>

Copyright (c) 2021 CData Software, Inc. - All rights reserved.
Build 21.0.7930