Help Center/
GaussDB/
Developer Guide(Centralized_2.x)/
Stored Procedure/
Basic Statements/
Call Statements
Updated on 2023-10-23 GMT+08:00
Call Statements
Syntax
Figure 1 shows the syntax diagram for calling a clause.
The above syntax diagram is explained as follows:
- procedure_name specifies the name of a stored procedure.
- parameter specifies the parameters for the stored procedure. You can set no parameter or multiple parameters.
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
-- Create the stored procedure proc_staffs. openGauss=# CREATE OR REPLACE PROCEDURE proc_staffs ( section NUMBER(6), salary_sum out NUMBER(8,2), staffs_count out INTEGER ) IS BEGIN SELECT sum(salary), count(*) INTO salary_sum, staffs_count FROM hr.staffs where section_id = section; END; / -- Invoke the stored procedure proc_return. openGauss=# CALL proc_staffs(2,8,6); -- Delete a stored procedure. openGauss=# DROP PROCEDURE proc_staffs; |
Parent topic: Basic Statements
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot