ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:userguide:learn_bind:bulkbinding

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
v5:userguide:learn_bind:bulkbinding [2016/03/23 01:55] – created mnewnhamv5:userguide:learn_bind:bulkbinding [2016/03/23 02:09] (current) – [Portable Support] mnewnham
Line 4: Line 4:
 Some databases, Oracle in particular, offer massive performance improvements in insertion performance when used with 2 dimensional bind arrays. This technique is known as ''Bulk Binding''. Some databases, Oracle in particular, offer massive performance improvements in insertion performance when used with 2 dimensional bind arrays. This technique is known as ''Bulk Binding''.
  
-==== Concept ====+===== Concept =====
 Using our previous example, let us assume that we need to insert multiple ''some_table'' records, and that we can determine the values to be inserted prior to the execution of all the statements Using our previous example, let us assume that we need to insert multiple ''some_table'' records, and that we can determine the values to be inserted prior to the execution of all the statements
  
 +===== Enabling Bulk Bind Support =====
 +Bulk Binding using 2D arrays is disabled by default in ADOdb. It must be deliberately enabled in the driver using the following syntax:
 +
 +<code php>
 +include 'adodb/adodb.inc.php';
 +
 +$db = newAdoConnection('drivername');
 +
 +$db->connect('parameters');
 +
 +/*
 +* Enable bulk binding
 +*/
 +$db->bulkBind = true;
 +</code>        
 +
 +===== Code Modifications =====         
 Traditionally, we might write our insert statement like this: Traditionally, we might write our insert statement like this:
  
Line 45: Line 62:
 </code> </code>
 ===== Portable Support ===== ===== Portable Support =====
-In databases without Bulk Binding support, ADOdb simply iterates through the $bindVars array, and executes them individually.+In databases without Bulk Binding support, ADOdb simply iterates through the $bindVars array, and executes the prepared statement individually.
  
-===== Enabling Bulk Bind Support ===== 
-Bulk Binding using 2D arrays is disabled by default in ADOdb. It must be deliberately enabled in the driver using the following syntax: 
- 
-<code php> 
-include 'adodb/adodb.inc.php'; 
- 
-$db = newAdoConnection('drivername'); 
  
-$db->connect('parameters'); 
- 
-/* 
-* Enable bulk binding 
-*/ 
-$db->bulkBind = true; 
-</code>                  
  
 <WRAP center info 300px> <WRAP center info 300px>
 **End Of Tutorial** **End Of Tutorial**
 </WRAP> </WRAP>
v5/userguide/learn_bind/bulkbinding.txt · Last modified: 2016/03/23 02:09 by mnewnham