Help Center/
GaussDB/
Developer Guide(Distributed_3.x)/
Application Development Guide/
ECPG-based Development/
Host Variables/
Overview
Updated on 2024-05-07 GMT+08:00
Overview
Passing data between a C program and SQL statements is particularly simple in embedded SQL. Instead of having the program paste data into the statements, you can simply write the name of a C variable into the SQL statement, prefixed by a colon. The following is an example.
EXEC SQL INSERT INTO sometable VALUES (:v1, 'foo', :v2);
This statement references two C variables named v1 and v2 and uses a regular SQL string, indicating that you are not restricted to use one kind of data or the other.
Parent topic: Host Variables
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