커스텀 쿼리 실행은 커넥터 태스크에서 작업으로 노출됩니다. 조치는 커넥터 인터페이스를 통해 통합에 제공되는 첫 번째 클래스 함수입니다. 조치를 사용하면 항목을 변경할 수 있습니다. 조치는 커넥터마다 다릅니다. 하지만 커넥터가 조치를 지원하지 않을 수 있으며 이 경우 Actions 목록이 비어 있습니다.
SQL 문에서 물음표(?)를 사용하여 쿼리 매개변수 목록에 지정해야 하는 단일 매개변수를 나타낼 수 있습니다. 예를 들어 다음 SQL 쿼리는 Employees 테이블에서 LastName 열에 지정된 값과 일치하는 모든 행을 선택합니다.
SELECT * FROM Employees where LastName=?
SQL 쿼리에 물음표를 사용한 경우에는 물음표마다 + 매개변수 이름 추가를 클릭하여 매개변수를 추가해야 합니다. 통합을 실행하는 동안 이 매개변수는 SQL 쿼리의 물음표(?)를 순차적으로 대체합니다. 예를 들어 물음표(?) 3개를 추가한 경우 매개변수 3개를 순서대로 추가해야 합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-09(UTC)"],[[["\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."]]