Summary
The 4th method of dynamic SQL uses Sqlda (the SQL Descriptor area) and Oracle to Exchange data to perform SQL statements that do not know the number and type of select table entries or virtual input host variables until the program is run.
Module Oracle's data
Jmp_buf |
Jmp_continue |
|
Save Program Breakpoint |
file* |
Orain |
Stdin |
Default input source |
file* |
Oraout |
StdOut |
Default output source |
Int |
Oraresult |
0 |
Error flag |
char* |
Dml_commands[] |
Slightly |
Data Manipulation Statement Verb table |
Oraquery |
Query |
|
Wrapping SQL Execution Process |
Oraquerybase |
Pquery |
&query |
Provide an external interface |
interface with the external
- Orain,oraout: The application changes the input and output source of the Oracle module by manipulating the two variables.
- Oraresult:oracle the execution result of the module (to be subdivided for error reasons).
- Oraconnect (User,password), Oradisconnect (): Establishes and disconnects from the database and must establish a connection before any SQL statements are executed.
- Jmp_for_error (label): If an Oracle module error occurs, go to the label label to continue execution, except when the connection is established.
- oraquerybase* Pquery: See the description of the abstract class Oraquerybase.
Abstract class Oraquerybase
Return data type |
Method name |
Parameters |
Describe |
Int |
Set |
Int,int,int |
To set the size of the SQL description area |
Int |
Alloc |
|
Assigning SQL Description Area |
Int |
Get_statement |
|
Reading SQL statements from an input source |
Int |
Set_statement] |
Const char* |
Enter SQL statements in string format |
Int |
Execute |
|
Execute the prepared SQL statement |
Int |
Free |
|
Releasing the SQL Description area |
Resources
"Programmer ' Guide to the Oracle precompilers" release 1.8
C + + Advanced reference manual