L11 SQL Programming Flashcards

1
Q

What is Dynamic SQL?

A

situations in which query statements themselves are assembled by the host language, perhaps using user input?

Usually consists of two steps (SQL statements):

  1. Preparing a query:

EXEC SQL PREPARE <query-name></query-name>

FROM ;

  1. Executing a query:

EXEC SQL EXECUTE <query-name>;</query-name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are stored procedures?

A
  • allow us to store procedures as database schema elements.
  • PSM (Persistent Stored Modules) = a mixture of conventional statements (if, while, etc.) and SQL.
  • Lets us do things we cannot do in SQL alone.
  • We can CREATE PROCEDUREs, e.g., and then CALL them from within SQL queries.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Embedded SQL?

A

A preprocessor turns SQL statements into procedure calls that fit with the surrounding host-language code.

I All embedded SQL statements begin with EXEC SQL, so the preprocessor can find them easily.

Embedded SQL is a method of combining the computing power of a programming language and the database manipulation capabilities of SQL. Embedded SQL statements are SQL statements written inline with the program source code of the host language. The embedded SQL statements are parsed by an embedded SQL preprocessor and replaced by host-language calls to a code library.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly