Using dynamic SQL Method 4 to connect Oracle implementations (version 1.0)

Source: Internet
Author: User
Tags abstract execution string format


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


"Programmer ' Guide to the Oracle precompilers" release 1.8

C + + Advanced reference manual

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.