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?
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:
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.DBMS_UTILITY.EXEC_DDL_STATEMENT
. Anything other than a true DDL will silently fail.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With