Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

Is it possible to parse C/C++ programs containing Embedded SQL statements in Enterprise Analyzer?

Is it possible to parse C/C++ programs containing Embedded SQL statements in Enterprise Analyzer?

Problem

As part of a user's system, there are some C or C++ modules that access SQL databases. Can these programs be loaded into Enterprise Analyzer (EA) alongside the Cobol and PL/I code that contains Embedded SQL statements?

Resolution

EA supports Embedded SQL only in the following languages:

  • Assembler
  • COBOL
  • PL/I

It does not support Embedded SQL in these languages:

  • C/C++
  • Java
  • VB

So, for C/C++ programs that have Embedded SQL, like Pro*C (i.e. C/C++ programs that work with an Oracle database), then the expanded C/C++ programs must be loaded into EA.

With a Pro*C program, it needs to be processed by the Oracle Pro*C pre-compiler. Normally, the pre-compile, the compile and link would all be done as one task, typically via a make file. As part of that process the C/C++file with the expanded calls may be deleted. Either the make file needs to be altered to retain the expanded C/C++ file or Pro*C needs to be run as standalone process so that the expanded C/C++ file is retained.

To be able to put a Pro*C program into EA and for it to parsed correctly, then the expanded C program that is produced by the Pro*C pre-compiler must be used.

There are various points to note when putting an expanded C program into EA.

  1. All the EXEC SQL statements are commented out by Pro*C and replaced with system calls to functions like sqlcxt. Pro*C will also use add Oracle specific classes like sqlca and sqlexd.
  2. The use of system functions and class will show up as references to unresolved functions and class as the code for these classes is not present within the workspace.
  3. When include statements are processed by EA, the use of angled brackets indicates that the header file is a system header file. System header files are searched for in a different way to user header files.
  4. System header files use the include directories that can be configured for C/C++ programs in either the workspace or project settings.

Incident # 2692452

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Version history
Revision #:
1 of 1
Last update:
‎2014-03-28 10:22
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.