Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DDL VS DCL difference

In Oracle site Types of SQL Statements Grant and Revoke belongs to DDL but in lot of other sites I see Grant and Revoke in DCL... which one is correct?

like image 292
Arunkumar Arjunan Avatar asked Oct 16 '25 17:10

Arunkumar Arjunan


1 Answers

It is best to treat GRANT and REVOKE as DDL.

As mathguy pointed out, neither definition is truly "correct". But I recommend you stick with the Oracle definition for two reasons:

  1. Oracle has thoroughly classified almost everything. Every possible Oracle SQL command from V$SQLCOMMAND will fit in their system. The only exceptions I've found are PL/SQL (an anonymous PL/SQL block), Invalid (a command that doesn't make sense), and Nothing (an empty string). One could argue that those aren't really SQL statements, although in some contexts it's still useful to classify them. I've found the Oracle classification system helpful for creating some PL/SQL language tools.
  2. The classification occasionally matters. For example, it's important to know exactly what Oracle considers to be DDL when calling DBMS_UTILITY.EXEC_DDL_STATEMENT. Anything other than a true DDL will silently fail.
like image 113
Jon Heller Avatar answered Oct 18 '25 07:10

Jon Heller



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!