rspec/rules/S2541/plsql/rule.adoc

34 lines
1011 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
Be careful about your use of Oracle-specific data types like ``++ROWID++`` and ``++UROWID++``. They might offer a slight improvement in performance over other means of identifying a single row (primary key or unique index value), but that is by no means guaranteed.
On the other hand, the use of ``++ROWID++`` or ``++UROWID++`` means that your SQL statement will not be portable to other SQL databases. Further, many developers are not familiar with these data types, which can make the code harder to maintain.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
2022-02-04 17:28:24 +01:00
[source,sql]
2021-04-28 16:49:39 +02:00
----
SET SERVEROUTPUT ON
DECLARE
id rowid; -- Non-Compliant
universeId urowid; -- Non-Compliant
BEGIN
SELECT rowid INTO id FROM DUAL;
SELECT rowid INTO universeId FROM DUAL;
DBMS_OUTPUT.PUT_LINE('id = ' || id);
DBMS_OUTPUT.PUT_LINE('universe id = ' || universeId);
END;
/
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
endif::env-github,rspecator-view[]