EXECUTE
Function
Executes a prepared statement. Because a prepared statement exists only in the lifetime of a session, the prepared statement must be created by an earlier PREPARE statement in the current session.
Precautions
If the PREPARE statement creating the prepared statement declares certain parameters, the parameter set transferred to the EXECUTE statement must be compatible. Otherwise, an error occurs.
Syntax
1
|
EXECUTE name [ ( parameter [, ...] ) ]; |
Parameter Description
- name
Specifies the name of the statement to be executed.
- parameter
Specifies a parameter of the prepared statement. It must be an expression that generates a value compatible with the data type specified when the prepared statement is created.
Examples
1 2 3 |
CREATE TABLE IF NOT EXISTS reason_t1 (a int,b varchar(20),c varchar(20)); PREPARE insert_reason(integer,character(16),character(100)) AS INSERT INTO reason_t1 VALUES($1,$2,$3); EXECUTE insert_reason(52, 'AAAAAAAADDAAAAAA', 'reason 52'); |
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.
For any further questions, feel free to contact us through the chatbot.
Chatbot