Skip to content

Latest commit

 

History

History
29 lines (27 loc) · 1.49 KB

File metadata and controls

29 lines (27 loc) · 1.49 KB
title SQL Modules | Microsoft Docs
ms.custom
ms.date 01/19/2017
ms.prod sql-non-specified
ms.reviewer
ms.suite
ms.technology
drivers
ms.tgt_pltfrm
ms.topic article
helpviewer_keywords
SQL modules [ODBC]
sending SQL statements to DBMS [ODBC]
SQL [ODBC], modules
modules [ODBC]
SQL statements [ODBC], modules
ms.assetid 07551472-87ee-4765-951f-1364ed32f0c0
caps.latest.revision 5
author MightyPen
ms.author genemi
manager jhubbard

SQL Modules

The second technique for sending SQL statements to the DBMS is through modules. Briefly, a module consists of a group of procedures, which are called from the host programming language. Each procedure contains a single SQL statement, and data is passed to and from the procedure through parameters.

A module can be thought of as an object library that is linked to the application code. However, exactly how the procedures and the rest of the application are linked is implementation-dependent. For example, the procedures could be compiled into object code and linked directly to the application code, they could be compiled and stored on the DBMS and calls to access plan identifiers placed in the application code, or they could be interpreted at run time.

The main advantage of modules is that they cleanly separate SQL statements from the programming language. In theory, it should be possible to change one without changing the other and simply relink them.