Procedures and functions in SQL.

SQL functions.


A function is a pre-described line that is executed when called. The syntax of SQL functions have characteristics. It is important that a function have unique names to avoid confusion in the system.
The functions are classified as follows:
1. Scalar functions: return a single value.

2. Online functions: return a set of results to a performed selection.

Note: In an online function, statements such as ORDER BY can not be used.

3. On-line functions of multiple statements: it is basically a function in Line, except that the execution of several SELECTs is used for it.
Triggers in SLQ

Are those that are triggered automatically by events, use DML (INSERT, DELETE or UPDATE). The steps to create it are:

Depending on the judgment used, the TRIGGER will start as defined by the administrator.

Procedures stored in SQL.


It is known as a set of instructions that are executed when indicated. For this, the EXECUTE keyword is used, accepting input parameters that indicate the type of data to be used, and may or may not generate results.

It is much safer to access the database than to have the lines of code and they are executed one by one. In the same order, you can control the level of how users access the database.


Comments

Popular Posts