Talk:Truncate (SQL): Difference between revisions

Content deleted Content added
Implementing WP:PIQA (Task 26)
DDL/DML
Line 10:
Is it really a DDL operation? I thought the whole idea was that it affected data/content and didn't affect metadata/structure. It feels much more like DML to me. [[User:Mhkay|Mhkay]] ([[User talk:Mhkay|talk]]) 16:36, 17 November 2022 (UTC)
 
 
:There's something better than "feels" --- it's explicitly documented in "Data manipulation" section in ISO SQL (sql:2011 and sql:2016). [[Special:Contributions/5.178.229.209|5.178.229.209]] ([[User talk:5.178.229.209|talk]]) 22:50, 16 May 2023 (UTC)
 
 
::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.
::I assert that the correct definition is product dependent:
::* 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.
::* 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)