Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added an implementation of bulk insert via the ORM to the Oracle DB b…

…ackend.

Refs #7596, r16739 and http://troels.arvin.dk/db/rdbms/#insert-multiple

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16819 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9fe050a27598cdce7f2ef7a332b4818b493a8702 1 parent 26b8122
Ramiro Morales authored

Showing 1 changed file with 5 additions and 0 deletions. Show diff stats Hide diff stats

  1. 5  django/db/backends/oracle/base.py
5  django/db/backends/oracle/base.py
@@ -78,6 +78,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
78 78
     supports_bitwise_or = False
79 79
     can_defer_constraint_checks = True
80 80
     ignores_nulls_in_unique_constraints = False
  81
+    has_bulk_insert = True
81 82
 
82 83
 class DatabaseOperations(BaseDatabaseOperations):
83 84
     compiler_module = "django.db.backends.oracle.compiler"
@@ -372,6 +373,10 @@ def _get_trigger_name(self, table):
372 373
         name_length = self.max_name_length() - 3
373 374
         return '%s_TR' % util.truncate_name(table, name_length).upper()
374 375
 
  376
+    def bulk_insert_sql(self, fields, num_values):
  377
+        items_sql = "SELECT %s FROM DUAL" % ", ".join(["%s"] * len(fields))
  378
+        return " UNION ALL ".join([items_sql] * num_values)
  379
+
375 380
 
376 381
 class _UninitializedOperatorsDescriptor(object):
377 382
 

0 notes on commit 9fe050a

Please sign in to comment.
Something went wrong with that request. Please try again.