Help Center/
GaussDB/
Developer Guide(Distributed_3.x)/
Application Development Guide/
ECPG-based Development/
Running SQL Commands/
Embedded SQL Commands/
VAR
Updated on 2024-05-07 GMT+08:00
VAR
Function
Assigns a new C data type to a host variable. The host variable must have been declared in a DECLARE segment.
- Exercise caution when using VAR. Using VAR to change the data type my cause the memory address to be invalid. As a result, the data variable is invalid and the value cannot be assigned.
- If the data type has been defined in the host variable DECLARE segment, you do not need to use the VAR statement.
Syntax
VAR varname IS ctype
Parameter Description
- varname
Name of a C variable.
- ctype
C type description.
Example
EXEC SQL BEGIN DECLARE SECTION; short a; EXEC SQL END DECLARE SECTION; EXEC SQL VAR a IS int;
Parent topic: Embedded SQL Commands
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