데이터베이스 연결에서 모든 저장 프로시져는 커넥터 태스크에서 조치로 노출됩니다. 조치는 커넥터 인터페이스를 통해 통합에 제공되는 첫 번째 클래스 함수입니다. 조치를 사용하면 항목을 변경할 수 있습니다. 조치는 커넥터마다 다릅니다. 하지만 커넥터가 조치를 지원하지 않을 수 있으며 이 경우 Actions 목록이 비어 있습니다.
customers 테이블에서 고객 정보를 가져오는 다음 저장 프로시져가 포함된 MySQL 데이터베이스가 있다고 가정해보세요.
CREATE PROCEDURE get_customer_info
(IN p_customer_id INT, OUT p_name VARCHAR(50), OUT p_email VARCHAR(255))
BEGIN
SELECT name, email INTO p_name, p_email
FROM customers
WHERE id = p_customer_id;
END
이 저장 프로시져는 지정된 고객의 이름 및 이메일을 반환합니다. p_customer_id 입력 변수를 통해 고객 ID를 가져오고 각각 p_name 및 p_email 출력 변수에 이름과 이메일을 반환합니다.
이제 customer_id=1001로 고객의 이름 및 이메일 ID를 가져온다고 가정하면 다음 태스크를 수행해야 합니다.
[[["이해하기 쉬움","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-04(UTC)"],[[["\u003cp\u003eStored procedures in a database connection are accessible as actions within the Connector task in Application Integration.\u003c/p\u003e\n"],["\u003cp\u003eConnectors such as BigQuery, Cloud SQL, MySQL, Oracle DB, PostgreSQL, SQL Server, MariaDB, AlloyDB, Snowflake, and Redshift support stored procedures.\u003c/p\u003e\n"],["\u003cp\u003eTo execute a stored procedure, you need to configure a Connector task with a database connection and select the desired procedure from the list of available actions.\u003c/p\u003e\n"],["\u003cp\u003eInput parameters for a stored procedure can be specified through a JSON payload in the Connector task's \u003ccode\u003econnectorInputPayload\u003c/code\u003e section.\u003c/p\u003e\n"],["\u003cp\u003eThe output of a successfully executed stored procedure will be returned as a JSON payload in the \u003ccode\u003econnectorOutputPayload\u003c/code\u003e variable.\u003c/p\u003e\n"]]],[],null,["# Execute a stored procedure\n==========================\n\nThis example shows how to run a stored procedure when you are using a database connection.\nThe example assumes that you are 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- Database stored procedures\n\nAll stored procedures in a database connection are exposed to you as actions 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 stored procedures:\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- [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- [SQL Server](/integration-connectors/docs/connectors/sqlserver/configure)\n- [MariaDB](/integration-connectors/docs/connectors/mariadb/configure)\n- [AlloyDB](/integration-connectors/docs/connectors/alloydb/configure)\n- [Snowflake](/integration-connectors/docs/connectors/snowflake/configure)\n- [Redshift](/integration-connectors/docs/connectors/redshift/configure)\n\n### Example\n\nConsider you have a MySQL database which has the following stored procedure that gets a\ncustomer's information from the `customers` table: \n\n```\nCREATE PROCEDURE get_customer_info\n(IN p_customer_id INT, OUT p_name VARCHAR(50), OUT p_email VARCHAR(255))\nBEGIN\n SELECT name, email INTO p_name, p_email\n FROM customers\n WHERE id = p_customer_id;\nEND\n```\n\nThis stored procedure returns the name and email for the specified customer. It takes\nin the customer ID through the `p_customer_id` input variable and returns the\nname and email in the `p_name` and `p_email` output variables, respectively.\n\nNow suppose you want to get the name and email id of the customer with `customer_id=1001`,\nyou must do the following tasks:\n\n1. Create a [connection to your MySQL database](/integration-connectors/docs/connectors/mysql/configure).\n2. Open or create a new [integration](/application-integration/docs/quickstarts).\n3. Add the [Connectors task](/application-integration/docs/configure-connectors-task) to your integration.\n4. In the **Configuration** section, click **Configure task** to open the **Configure connector task** pane.\n5. Configure the Connectors task to use the connection you created in step 1.\n 1. In the **Connection** column, select the required connection from the list of available connections.\n\n\n After you select a connection, the **Type** column appears with the values\n `Entities` and `Actions`. All the stored procedures will be listed\n in **Actions**.\n 2. Select **Actions \\\u003e get_customer_info**.\n 3. Click **Done** to complete the connection configuration and close the pane.\n6. Click the `Connectors` task element, and then click `connectorInputPayload` in the `Task Input` section.\n7. Specify the following JSON payload in the `Default Value` field: \n\n ```\n {\n \"customer_id\": 1001\n }\n ```\n8. Click the **Test** button in the integration editor toolbar to run the integration.\n\n If the integration runs successfully, the `connectorOutputPayload`\n vairable will have a JSON payload similar to the following: \n\n ```\n {\n \"name\": \"John\",\n \"email\": \"john@test.com\"\n }\n ```"]]