[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-19。"],[[["\u003cp\u003eThis guide explains how to use the "Execute custom query" action within the Connector task, which allows for the execution of custom SQL queries in Application Integration.\u003c/p\u003e\n"],["\u003cp\u003eThe "Execute custom query" action is a feature of several connectors, including BigQuery, Cloud SQL, Couchbase, Elasticsearch, MySQL, Oracle DB, PostgreSQL, Salesforce, SQL Server, Snowflake, Spanner, and Teradata, allowing flexibility for the user.\u003c/p\u003e\n"],["\u003cp\u003eTo set up a custom query, users must add and configure a connector task, then select "Execute custom query" from the available actions.\u003c/p\u003e\n"],["\u003cp\u003eUsers can define query parameters, set timeouts, limit the number of returned rows, and use the script editor to input and save SQL statements, including DML and DDL.\u003c/p\u003e\n"],["\u003cp\u003eSQL queries may contain parameters represented by a question mark (?) that must be specified in the parameters list, following the same sequence as the question marks.\u003c/p\u003e\n"]]],[],null,["# Execute custom query\n====================\n\nThis page shows you how to execute a custom SQL query. To execute a custom query, you must be familiar with the following concepts:\n\n- [Creating integrations using Application Integration](/application-integration/docs/try-sample-integration-ecommerce)\n- [Connector task](/application-integration/docs/configure-connectors-task)\n- [Integration Connectors](/integration-connectors/docs/overview)\n- SQL queries\n\n\u003cbr /\u003e\n\nThe **Execute custom query** is exposed to you as an action in the\n[Connector task](/application-integration/docs/configure-connectors-task). An action is a first\nclass function that is made available to the integration through the connector interface. Actions\nlet you make changes to an entity or entities, and vary from connector to connector. However, it is possible\nthat a connector doesn't support any action, in which case the `Actions` list will be empty.\n\nThe following connectors support custom query:\n\n- [BigQuery](/integration-connectors/docs/connectors/bigquery/configure)\n- [Cloud SQL - MySQL](/integration-connectors/docs/connectors/cloudsqlformysql/configure)\n- [Cloud SQL - PostgreSQL](/integration-connectors/docs/connectors/cloudsqlforpostgresql/configure)\n- [Cloud SQL - SQL Server](/integration-connectors/docs/connectors/cloudsqlforsqlserver/configure)\n- [Couchbase](/integration-connectors/docs/connectors/couchbase/configure)\n- [Elasticsearch](/integration-connectors/docs/connectors/elasticsearch/configure)\n- [MySQL](/integration-connectors/docs/connectors/mysql/configure)\n- [Oracle DB](/integration-connectors/docs/connectors/oracledb/configure)\n- [PostgreSQL](/integration-connectors/docs/connectors/postgresql/configure)\n- [Salesforce](/integration-connectors/docs/connectors/salesforce/configure)\n- [SQL Server](/integration-connectors/docs/connectors/sqlserver/configure)\n- [Snowflake](/integration-connectors/docs/connectors/snowflake/configure)\n- [Spanner](/integration-connectors/docs/connectors/cloudspanner/configure)\n- [Terdata](/integration-connectors/docs/connectors/teradata/configure)\n\n### Create a custom query\n\n\nTo create a custom query, follow these steps:\n\n1. Follow the detailed instructions to [add a connectors task](/application-integration/docs/configure-connectors-task#add-a-connectors-task).\n2. When you [configure the connector task](/application-integration/docs/configure-connectors-task#configure-the-connectors-task), in the type of action you want to perform, select **Actions**.\n3. In the **Action** list, select **Execute custom query** , and then click **Done** .\n\n\n4. Expand the **Task input** section, and then do the following:\n 1. In the **Timeout after** field, enter the number of seconds to wait till the query executes.\n\n Default value: `180` seconds.\n 2. In the **Maximum number of rows** field, enter the maximum number of rows to be returned from the database.\n\n Default value: `25`.\n 3. To update the custom query, click **Edit Custom Script** . The **Script editor** dialog opens.\n\n\n 4. In the **Script editor** dialog, enter the SQL query and click **Save** .\n\n You can use a question mark (?) in a SQL statement to represent a single parameter that must be specified in the query parameters list. For example, the following SQL query selects all rows from the `Employees` table that matches the values specified for the `LastName` column: \n\n ```\n SELECT * FROM Employees where LastName=?\n ```\n\n \u003cbr /\u003e\n\n | **Note:** Data manipulation language (DML) and data definition language (DDL) statements are supported.\n 5. If you've used question marks in your SQL query, you must add the parameter by clicking **+ Add Parameter Name** for each question mark. While executing the integration, these parameters replace the question marks (?) in the SQL query sequentially. For example, if you have added three question marks (?), then you must add three parameters in order of sequence.\n\n\n To add query parameters, do the following:\n 1. From the **Type** list, select the data type of the parameter.\n 2. In the **Value** field, enter the value of the parameter.\n 3. To add multiple parameters, click **+ Add Query Parameter**.\n 6. The **Execute custom query** action does not support array variables."]]