+ 3
What are stored procedures?
4 Réponses
+ 6
In a DBMS, a stored procedure is a set of SQL statements with an assigned name that's stored in the database in compiled form so that it can be shared by a number of programs.
The use of stored procedure can be helpful in:
1- Providing a controlled access to data (end users can only enter or change data but can't write procedures)
2- Ensuring data integrity (data would be entered in consistent manner)
3- Improves productivity (the statements of stored procedure need to be written only once)
+ 2
It is a 'piece' of code like a function that is write and saved in the database. It runs when is invoked
+ 1
SP is a kind of batch script saved in DB.
Imagine OS shell scripts. sometimes they could be a shortcut for long code or a unit of meaning-full job and also could be flexible with input parameters.
0
A procedure (often called a stored procedure) is a subroutine like a subprogram in a regular computing language, stored in database. A procedure has a name, a parameter list, and SQLstatement(s). All most all relational database system supports stored procedure, MySQL 5 introduce stored procedure.