0

PSM is a procedural extension to SQL.

  1. Are the following concepts provided by SQL or SQL/PSM:

    • functions
    • procedures
    • triggers?

    (I read https://stackoverflow.com/a/1179778/156458 for the differences between functions and procedures, and if I am correct, functions are not procedures, procedures are not functions, and triggers are procedures. So I am further curious whether they come from SQL or from SQL/PSM.)

  2. Are the above three concepts of DDL or DML?

Thanks.

Tim
  • 1
  • 141
  • 372
  • 590

1 Answers1

1

Looks like SQL/PSM is an extension of PL/SQL and SQL/PSM was inspired by it to have similar procedures & functions. Not sure about Triggers though.

You can say procedures, functions & triggers came from SQL. They are obviously DML, because they don't define the data. They only manipulate the data.

Procedures can insert, update or delete records. Functions can calculate and return values. Triggers are like procedures, that run when a particular condition is met. Like a deletion on a master table. (It could be a before trigger, which will delete its child records!)

Sammy
  • 47
  • 7
  • 2
    SQL/PSM is **NOT** an "extension" to PL/SQL. PL/SQL is a proprietary language implemented in the Oracle database. SQL/PSM is part of the ANSI SQL standard (and PL/SQL is not even compatible with SQL/PSM) –  May 08 '18 at 14:56