Sobes.tech
Middle+

Stored Procedures and Functions — do they exist in PostgreSQL, MS SQL, Oracle?

sobes.tech AI

Answer from AI

In PostgreSQL, MS SQL, and Oracle, both Stored Procedures and Functions are supported, but with some differences:

  • PostgreSQL:

    • Supports both procedures and functions.
    • Functions can return values and be used in SQL expressions.
    • Procedures appeared in version 11, they do not return values directly, and are called with the CALL command.
  • MS SQL Server:

    • Supports stored procedures (Stored Procedures) and user-defined functions (User-Defined Functions).
    • Procedures perform operations and can return execution status.
    • Functions return values and can be used in queries.
  • Oracle:

    • Supports procedures and functions in PL/SQL.
    • Procedures perform actions, functions return values.
    • Procedures are called separately, functions can be used in SQL.

Thus, all three DBMSs have both object types, but their syntax and capabilities may differ.