Skip to main content

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

  • March 28, 2014
  • 0 replies
  • 0 views

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


#EnterpriseAnalyzer
#Pro*Csupport
#SupportTip
#EnterpriseAnalyser
#EmbeddedSQL

0 replies

Be the first to reply!