ECPG-based Development
Embedded SQL C Preprocessor (ECPG) for GaussDB Kernel is an embedded SQL preprocessor for C programs. An embedded SQL program consists of code written in an ordinary programming language, in this case C, mixed with SQL commands in specially marked sections. To build the program, the source code (*.pgc) is first passed through the embedded SQL preprocessor, which converts it to an ordinary C program (*.c), and afterwards it can be processed by a C compiler. Converted ECPG applications call functions in the libpq library through the embedded SQL library (ecpglib), and communicate with the GaussDB Kernel server using the normal frontend-backend protocol.
EXEC SQL ...;
These statements syntactically take the place of a C statement. Depending on the particular statement, they can appear at the global level or within a function. Embedded SQL statements follow the case-sensitivity rules of normal SQL code, and allow nested C code-style comments (part of the SQL standard). However, the C part of the program follows the standards of the C program and does not support nested comments.
- Development Process
- ECPG Components
- ECPG Preprocessing and Compiling
- Managing Database Connections
- Running SQL Commands
- Querying the Result Set
- Closing a Database Connection
- Host Variables
- Executing Dynamic SQL Statements
- Error Handling
- Preprocessor Directives
- Using Library Functions
- SQL Descriptor Area
- Examples
- ecpg and Pro*C Compatibility Comparison
- ECPG API Reference
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