Help Center/ GaussDB/ Developer Guide(Distributed_V2.0-8.x)/ Application Development Guide/ ECPG-based Development/ Running SQL Commands/ Embedded SQL Commands/ EXECUTE IMMEDIATE
Updated on 2025-08-19 GMT+08:00
EXECUTE IMMEDIATE
Function
Immediately prepares and executes a dynamically specified SQL statement without retrieving result rows.
Syntax
EXECUTE IMMEDIATE string
Parameter Description
string
A C string or host variable that contains the SQL statement to be executed.
Example
The following is an example of executing the INSERT statement using EXECUTE IMMEDIATE and a host variable named command:
sprintf(command, "INSERT INTO test (name, amount, letter) VALUES ('db: ''r1''', 1, 'f')");
EXEC SQL EXECUTE IMMEDIATE :command; Parent topic: Embedded SQL Commands
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.
The system is busy. Please try again later.