Oracle Pro*C to ODBC Conversion

Migrate smoothly Oracle Pro*C to ODBC with Ispirer Migration and Modernization Toolkit 2017!

We develop our migration tool Ispirer MnMTK 2017 using customer-oriented approach in order to satisfy client’s business needs.

Ispirer MnMTK database API migration tool automatically detects EXEC SQL statements and host variables, converts them to ODBC API and pastes additional code.

Conversion features

Ispirer MnMTK performs the following actions:

  • Adds include files for ODBC API functions and structures:
    • #include
    • #include
  • Converts Oracle Pro*C database connection - EXEC SQL CONNECT TO to ODBC connection in the following way:
    • allocating environment handle
    • allocating connection handle
  • Establishes a connection using functions:
    • SQLConnect()
    • SQLDriverConnect()
    • SQLBrowseConnect()
  • Converts Oracle Pro*C statements operating with data to corresponding ODBC API functions:
    • SQLPrepare()
    • SQLExecute()
    • SQLBindParameter()
    • SQLFetch(), etc.
  • Converts DDL and DML statements to query string.

Oracle Pro*C example (file: simple.pc):

Pro*C
  1. EXEC SQL include sqlca;
  2. int main()
  3. {
  4. EXEC SQL DECLARE cur_name CURSOR FOR
  5. SELECT NVL(COL_NAME,' ')
  6. FROM TBL_NAME;
  7. EXEC SQL OPEN cur_name;
  8. return 0;
  9. }

After the conversion simple.pc file is converted to simple.cpp (using SQL Server Data Base):

ODBC
  1. #include <sql.h>
  2. #include <sqlext.h>
  3. SQLHENV env;
  4. int main()
  5. {
  6. SQLHSTMT cur_name;
  7. sqlca.sqlcode = SQLAllocStmt(connection,&cur_name);
  8. sqlca.sqlcode = SQLPrepare(cur_name,
  9. "SELECT ISNULL(COL_NAME,' ') "\
  10. " FROM TBL_NAME",SQL_NTS);
  11. sqlca.sqlcode = SQLExecute(cur_name);
  12. return 0;
  13. }

Ispirer MnMTK generates sqlca struct to replicate the application logic:

ODBC
  1. struct
  2. {
  3. SQLRETURN sqlcode;
  4. SQLCHAR sqlerrm[SQL_MAX_MESSAGE_LENGTH+1];
  5. SQLCHAR sqlstate[SQL_SQLSTATE_SIZE+1];
  6. SQLSMALLINT length;
  7. } sqlca;

Please complete the questionnaire to initiate collaboration discussions for your project or get some rough estimation:

Get a Demo

Ispirer MnMTK License

Oracle Pro*C to ODBC

Request a Quote

Ispirer MnMTK License

Oracle Pro*C to ODBC

Get an Estimate

Ispirer Migration Service

Oracle Pro*C to ODBC

What Our Customers Say

Sybase ASE to PostgreSQL

Oracle PL/SQL to Splice Machine

Oracle to Microsoft SQL Server

IBM DB2 to Microsoft SQL Server

previous arrow
next arrow
Slider