Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Stored procedure
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Implementation == Stored procedures are similar to [[user-defined function]]s (UDFs). The major difference is that UDFs can be used like any other expression within SQL statements, whereas stored procedures must be invoked using the <code>CALL</code> statement.<ref>{{Cite web |title=Db2 12 - Application programming and SQL - Calling a stored procedure from your application |url=https://www.ibm.com/docs/en/db2-for-zos/12?topic=zos-calling-stored-procedure-from-your-application |access-date=2022-05-26 |website=www.ibm.com |language=en-us}}</ref> CALL procedure(...) or EXECUTE procedure(...) The exact and correct implementation of stored procedures varies from one database system to the other. Most major database vendors support them in some form. Depending on the database system, stored procedures can be implemented in a variety of [[programming language]]s, for example [[SQL]], [[Java (programming language)|Java]], [[C (programming language)|C]], or [[C++]]. Stored procedures written in non-SQL languages may or may not execute SQL statements themselves. The increasing adoption of stored procedures led to the introduction of procedural elements to the SQL language in the [[SQL:1999]] and [[SQL:2003]] standards in the part [[SQL/PSM]]. That made SQL an [[imperative programming language]]. Most database systems offer proprietary and vendor-specific extensions, exceeding SQL/PSM. A standard specification for [[Java stored procedure]]s exists as well as [[SQL/JRT]]. {| class="wikitable sortable" |- ! Database system ! Implementation language |- | [[CUBRID]] | [[Java (programming language)|Java]] |- | [[IBM Db2]] | [[SQL PL]] (close to the [[SQL/PSM]] standard) or [[Java (programming language)|Java]] |- | [[Firebird (database server)|Firebird]] | PSQL (Fyracle also supports portions of Oracle's PL/SQL) |- | [[Informix]] | [[Java (programming language)|Java]] |- | [[Interbase]] | Stored Procedure and Trigger Language |- | [[Microsoft SQL Server]] | [[Transact-SQL]] and various [[.NET Framework]] languages |- | [[MySQL]], [[MariaDB]] | own stored procedures, closely adhering to [[SQL/PSM]] standard |- | [[NuoDB]] | [[SQL]] or [[Java (programming language)|Java]] |- | [[Virtuoso Universal Server|OpenLink Virtuoso]] | Virtuoso SQL Procedures (VSP);<ref name="SQL Procedure Language Guide">{{cite web|url=http://docs.openlinksw.com/virtuoso/ch-sqlprocedures/|title=Chapter 11. SQL Procedure Language Guide|website=OpenLink documentation|access-date=11 September 2019}}</ref> also extensible via Java, C, and other programming languages |- | [[Oracle database|Oracle]] | [[PL/SQL]] or [[Java (programming language)|Java]] |- | [[PostgreSQL]] | [[PL/pgSQL]], can also use own function languages such as PL/Tcl, PL/Perl or PL/Python<ref>{{cite web |title=Chapter 42. Procedural Languages |url=https://www.postgresql.org/docs/current/xplang.html |website=PostgreSQL Documentation |access-date=20 November 2023 |language=en |date=9 November 2023}}</ref> |- | [[SAP HANA]] | [https://help.sap.com/viewer/de2486ee947e43e684d39702027f8a94/2.0.03/en-US/297af2926307446cbbfb1a8f96fec941.html SQLScript] or [[R (programming language)|R]] |- | [[SAP Adaptive Server Enterprise|SAP ASE]] | [[Transact-SQL]] |- | [[SAP SQL Anywhere]] | [[T-SQL]], [[Watcom SQL]], [[Java (software platform)|Java]], or [[C (programming language)|C]]/[[C++]]) |- | [[SQLite]] | Not supported |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)