summaryrefslogtreecommitdiff
path: root/django/db/models/functions/text.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/functions/text.py')
-rw-r--r--django/db/models/functions/text.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/db/models/functions/text.py b/django/db/models/functions/text.py
index 500fbea194..392061880c 100644
--- a/django/db/models/functions/text.py
+++ b/django/db/models/functions/text.py
@@ -261,13 +261,14 @@ class Reverse(Transform):
def as_oracle(self, compiler, connection, **extra_context):
# REVERSE in Oracle is undocumented and doesn't support multi-byte
# strings. Use a special subquery instead.
+ suffix = connection.features.bare_select_suffix
sql, params = super().as_sql(
compiler,
connection,
template=(
"(SELECT LISTAGG(s) WITHIN GROUP (ORDER BY n DESC) FROM "
- "(SELECT LEVEL n, SUBSTR(%(expressions)s, LEVEL, 1) s "
- "FROM DUAL CONNECT BY LEVEL <= LENGTH(%(expressions)s)) "
+ f"(SELECT LEVEL n, SUBSTR(%(expressions)s, LEVEL, 1) s{suffix} "
+ "CONNECT BY LEVEL <= LENGTH(%(expressions)s)) "
"GROUP BY %(expressions)s)"
),
**extra_context,