
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
44 lines
1.2 KiB
Plaintext
44 lines
1.2 KiB
Plaintext
== Why is this an issue?
|
|
|
|
In most databases, the SQL ``++TRUNCATE++`` statement has the following side effects:
|
|
|
|
* The table being truncated is locked during the operation
|
|
* The transaction log is not updated during the operation, which means that a TRUNCATE operation can't be part of a transaction.
|
|
* ``++DELETE++`` triggers are not fired during truncation
|
|
|
|
For these reasons use of the ``++TRUNCATE++`` statement may not be permitted in some environments. This rule flags all uses of the ``++TRUNCATE++`` statement.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,text]
|
|
----
|
|
EXEC SQL TRUNCATE MY_TABLE END-EXEC.
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,text]
|
|
----
|
|
EXEC SQL DELETE FROM MY_TABLE END-EXEC.
|
|
----
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== on 14 May 2014, 09:32:40 Freddy Mallet wrote:
|
|
Waiting for additional explanations from BNP
|
|
|
|
=== on 27 May 2014, 13:03:31 Ann Campbell wrote:
|
|
I've expanded this one slightly - found a third reason not to truncate online and added a compliant solution. Please double-check me.
|
|
|
|
=== on 10 Jul 2014, 07:28:39 Freddy Mallet wrote:
|
|
We've finally decided to not support this controversial rule.
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|