Talk:Truncate (SQL): Difference between revisions

Content deleted Content added
DDL/DML
Oradium (talk | contribs)
DDL: Reply
 
(2 intermediate revisions by one other user not shown)
Line 14:
 
 
::I strongly agree with Mhkay:
::In SQL:2023 it's in the SQL ''data change statement'' category according to [https://standards.iso.org/iso-iec/9075/-2/ed-6/en/ISO_IEC_9075-2(E)_Foundation.bnf.txt][Https://standards.iso.org/iso-iec/9075/-2/ed-6/en/ISO IEC 9075-2(E) Foundation.bnf.txt https://standards.iso.org/iso-iec/9075/-2/ed-6/en/ISO_IEC_9075-2(E)_Foundation.bnf.txt], i.e. a DML statement.
: Furthermore, I have been communicating about this with someone who has access to the ISO standard. He states:
::I assert that the correct definition is product dependent:
<blockquote>
::* If the DBMS implements it in a way where triggers are not fired by TRUNCATE, then it's a DDL, because it's essensially a short-hand for DROP+CREATE.
TRUNCATE is:
::* If the DBMS implements it as as a logical synonym with an unconstrained DELETE, then natural logic puts it in the DML category.
 
::[[User:Troels Arvin|Troels Arvin]] ([[User talk:Troels Arvin|talk]]) 07:35, 13 November 2024 (UTC)
- an "SQL-data change statement"
- therefore an "SQL-data statement"
 
It is not:
 
- an "SQL-schema statement"
 
The terms DDL and DML are not used in the SQL standard, but those above are pretty much the equivalents. So it is definitely a DML statement.
</blockquote>
: So I'm going to change the article.
:: [[User:Troels Arvin|Troels Arvin]] ([[User talk:Troels Arvin|talk]]) 0714:3530, 1330 NovemberDecember 2024 (UTC)
::Just to add weight to Troels' point. Although the ISO SQL standard does not use the term DML it does put TRUNCATE under Chapter 14 Data Manipulation, along with all the other "DML" statements and separate from the Schema Definition statements in Chapter 11. A few, but not all, database vendors have historically chosen to describe TRUNCATE as "data definition" statements because that suited their own agendas. The ISO standard ought to be the basis for a NPOV. [[User:Oradium|Oradium]] ([[User talk:Oradium|talk]]) 14:56, 1 January 2025 (UTC)