Is ESQL used in industry?

I am taking a database course and I need to write a command line application. The professor wants us to write an ESQL application (embed SQL).

I have the feeling that this kind of technology is depreciating.

We must use oracle precompiler to translate esql code in C ++. Such applications look awful to support.

The php application will also work well, but they probably want the command line application to evaluate faster (unit test with source channel). What do you guys think is Embed SQL used in this industry, is it worth asking a professor to make a Java application? Is there another technology?

+6
database oracle embedded-sql
source share
7 answers

Embedded SQL was one of the most popular ways to execute SQL in C during the "old days" (C ++ had not yet been invented).

These days, we will mainly use the ORM library. It is not recommended to do embedded SQL anymore, because, as you put it, it depends on the proprietary preprocessor and makes it difficult to debug, manage and maintain code. It also binds you to one database provider, and your code will be extremely difficult to move to another database server. As a rule, we do not do this in "real life".

But since this is just a class, your professor is probably interested in teaching you SQL and database concepts. Embedded SQL is just a tool. You should learn SQL and databases, not embedded SQL in C ++.

However, I find that you are missing the point when asking about PHP and Java. Not to mention that PHP is a scripting language, and Java is another language in which you can (potentially) write a processor for embedded SQL.

So, your point about embedded SQL really has nothing to do with language selection. This is due to trade-offs and the balance between (1) a patented embedded system with a preprocessor, (2) using an ORM library or a data access library (e.g. ODBC).

Off-Topic:

At first I started using embedded SQL when I was in college (it was about 30 years ago!). In fact, he got programming from the College and still used it, but obviously that was on the way. I have never seen it used since 1990 or so.

+8
source share

Yes, but no. I have not seen a single line of Embedded SQL in 10 years of work in this area. I would say (and hope) that this technology exists only in (some) legacy systems.

Currently, development related to the industry database will include:

  • Direct access to the database using JDBC, ADO.NET, OLE DB, ODBC or native libraries ( OCCI in your case).
  • ORM (Hibernate, Entity Framework, or home solution).
  • Some level of data access based on frameworks and / or templates (think Ruby on Rails, Active Record or a home solution).

IMHO, home solutions should be uprooted, but they are more common than you think. Part of this, of course, should have concerned students who were just experimenting with outdated and non-adapted tools at school ...

The ORMs (and data access levels) associated with the problems can be very complex, and I would say that it is very interesting to see. Especially if you are a student. I would recommend delving into Martin Fowler P from EAA .

In C ++, I would look at SOCI .

+4
source share

We must maintain on the old system here (20 years and older).

ESQL is used massively here. Most of the problems we had when moving the software to the new OS (it was 15-year-old hpux), where with the ESQL code.

The new software that we write all uses the C ++ library. This gives us more readable code + our IDE does not say "invalid syntax" all the time. etc .. The C ++ library in general is very similar to the way I connect to the database in .NET or Java.

Using the C ++ library has improved speed (if used wisely) and a lot less errors.

ESQL is deprecated from my point of view. But since we entered the time when a lot of written software should update / update or support existing systems, it’s very convenient to have basic knowledge about old methods!

+4
source share

I have not seen embedded SQL in an application for 10 years. The last time I saw it was in the mainframe application written in COBOL. Yes, still used by an electrical company.

The little C ++ programming that I am doing these days does not include SQL. These days, most of the DB relational programs I come across are one of the following:

  • ORM (Relational Object Mapping - Hibernate or JPA)
  • Jdbc
  • stored procedures (oracle or mySQL)
+2
source share

While this is probably deprecated (I also did ESQL ~ 15-20 years ago), it can still serve as a good example of how and where to approach - even if you only like to enjoy ORM more.

Also, from my understanding of LINQ in .NET, it is somewhat similar to the idea of ​​embedding SQL in the host language - and LINQ seems pretty popular.

Extraction from this to a wider CS, embedded DSL, apparently, is a hot topic of research, so the example of ESQL as an early version is not too far from today's world.

+1
source share

ESQL is the main language that is very common for IBM Middleware products. This is not an object-oriented language, but a procedure language. It is widely used in some places for mapping between XML (an alias for XSLT).

+1
source share

I have been using ESql since the date in the Informix 9.x database in the legacy C ++ application code that I am working on as part of my work.

Although I agree that this is an old technique, and there are better options, I would say that this is a very neat technique. The good part is SQL, built in as part of the C / C ++ code stream, the syntax is wise and logical. The small syntax change that ESql brings is easy to recognize, and therefore I say it's fun to use.

As Heiko mentioned, LINQ is close to the idea of ​​ESql.

0
source share

All Articles