Why We use Embedded SQL?

Embedded SQL:

Structured Query Language (SQL) is a non-procedural language. Embedded SQL gives us the freedom to use databases as and when required. Once the application we develop goes into the production mode several things need to be taken care of. With the help of the embedding of queries, we can easily use the database without creating any bulky code. With the embedded SQL, we can create APIs that can easily fetch and feed data as and when required.

Advantages of Embedded SQL:

1. Small Footprint Database: As embedded SQL uses an UltraLite database engine compiled for each application. The footprint is smaller than when using an UltraLite component for a small number of tables. For a large number of tables, this benefit is lost.

2. High Performance: It combines the high performance of C and C++ applications with the optimization of the generated code, including data access plans, making embedded SQL a good choice for high-performance application development.

3. Extensive SQL support: With embedded SQL you can use a wide range of SQL in your applications.

Disadvantages of Embedded SQL:

1. Knowledge of C or C++ required: If you are not familiar with C or C++ programming, you may wish to use one of the other UltraLite interfaces. UltraLite components provide interfaces from several popular programming languages and tools.

2. Complex Development Model: The use of a reference database to hold the UltraLite database schema, together with the need to preprocess your source code files, makes the embedded SQL development process complex. The UltraLite components provide a much simpler development process.

3. SQL must be specified at design time: Only SQL statements defined at compile time can be included in your application. The UltraLite components allow the dynamic use of SQL statements.