Highlighted
Absent Member.
Absent Member.
2539 views

What options are there for embedded SQL access in COBOL?

Jump to solution

[Migrated content. Thread originally posted on 20 February 2012]

Using embedded SQL statements in a COBOL program is a fairly common thing to do but even if you've been doing this for a while, it's not always clear what options are available. Here's a quick summary of what you can do and when you need to opt for one approach over another.

Generally speaking, there are 2 approaches to accessing a database from a COBOL program that contains embedded SQL statements:

1. Use the Database vendor’s pre-compiler. The pre-compiler takes as input the COBOL source file and outputs another file that is compiled by the Micro Focus COBOL compiler.

2. Use Micro Focus OpenESQL technology.


There are some upsides and drawbacks to using the a pre-compiler:

1. The pre-compiler can offer extra performance over OpenESQL but this is generally negligible.

2. The pre-compiler allows you to access non-standard DB-specific extensions.

3. Compilation is a two stage process. Pre-compiler and then COBOL compilation.

4. The debugging experience isn’t integrated – the developer debugs the pre-compiler output and not the actual embedded SQL originally coded.

5. Pre-compilers do not currently support managed code, JVM or .NET.


COBSQL -- Micro Focus provides a technology called COBSQL which improves the developer experience when using pre-compilers. Points 3 and 4 are much improved using this technology.


OpenESQL provides ubiquitous database access. No database vendor pre-compiler is required. Again, upsides and drawbacks:

1. OpenESQL is database agnostic, COBOL programs can be switched to use a new database with no changes.

2. OpenESQL is the only technology which allows ADO.NET and JDBC access by COBOL programs.

3. Performance may be slightly reduced over pre-compilers but this is generally negligible.

4. OpenESQL may not support non-standard ANSI SQL extensions that some database vendors provide. So it is possible that moving to ESQL from a pre-compiler will require updating the code to replace these extensions.

Certification
Database vendors take responsibility for certifying their pre-compilers with Micro Focus technology. However, Micro Focus also tests all the major databases, DB2 LUW, Oracle and SQLServer.

For other databases, vendors that provide ODBC access to their database can be accessed with Micro Focus OpenESQL technology. There are on occasion nuances we encounter with the ODBC implementations of some vendors, when we discover these we usually rectify within OpenESQL.
0 Likes
2 Solutions

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: What options are there for embedded SQL access in COBOL?

Jump to solution
One item that I would add under the OpenESQL category is that the OpenESQL Assistant product is available for use when you choose this option.

OpenESQL Assistant is a powerful tool that makes it fast and easy to generate SQL queries that you can embed right into your COBOL programs. You can also test your queries to be sure they return the information you need before embedding them into a program. OpenESQL Assistant can also generate auxiliary code necessary to properly execute an embedded SQL query.

For more information on OpenESQL Assistant please see the documentation here:

View solution in original post

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: What options are there for embedded SQL access in COBOL?

Jump to solution

Sorry, please try this link instead.

View solution in original post

0 Likes
4 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: What options are there for embedded SQL access in COBOL?

Jump to solution
One item that I would add under the OpenESQL category is that the OpenESQL Assistant product is available for use when you choose this option.

OpenESQL Assistant is a powerful tool that makes it fast and easy to generate SQL queries that you can embed right into your COBOL programs. You can also test your queries to be sure they return the information you need before embedding them into a program. OpenESQL Assistant can also generate auxiliary code necessary to properly execute an embedded SQL query.

For more information on OpenESQL Assistant please see the documentation here:

View solution in original post

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

RE: What options are there for embedded SQL access in COBOL?

Jump to solution

Your link to the information appears to be a broken link.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: What options are there for embedded SQL access in COBOL?

Jump to solution

Sorry, please try this link instead.

View solution in original post

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

RE: What options are there for embedded SQL access in COBOL?

Jump to solution

Thanks

0 Likes
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.