> For the complete documentation index, see [llms.txt](https://vikram-bajaj.gitbook.io/cs-gy-6083-principles-of-database-systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vikram-bajaj.gitbook.io/cs-gy-6083-principles-of-database-systems/main-1/sql/advanced-sql/accessing-sql-from-a-programming-language/embedded-sql.md).

# Embedded SQL

Embedded SQL refers to embedding SQL queries in another language.

SQL can be embedded in various languages including C, Java and Cobol.

A language into which SQL queries are embedded is referred to as a **host language**, and the SQL structures permitted in the host language comprise **embedded SQL**.

The EXEC SQL statement is used to identify embedded SQL request to the preprocessor:

```
EXEC SQL <embedded SQL statement> END_EXEC
```

Note that this varies by language. Java embedding uses:

```
# SQL {...};
```
