nsmcp::DatabaseSession method batchInsert (public)

 <instance of nsmcp::DatabaseSession[i]> batchInsert \
    [ -mapping mapping ] [ -schema schema ] table batch

Defined in /usr/local/ns/tcl/nsmcp/database.tcl

Insert a supplied prepared batch using core nsdb's batch API. Pass optional column mapping and schema metadata to the owned database handle.

Switches:
-mapping (optional)
Optional core batch column mapping.
-schema (optional)
Optional prepared-row schema.
Parameters:
table (required)
Target table identifier accepted by core batch insertion.
batch (required)
Prepared batch object or rows accepted by core nsdb.
Returns:
The batch insertion result returned by ns_db.

Testcases:
No testcase defined.
Source code:
set options [list -table $table]
if {$mapping ne {}} {
    lappend options -columns $mapping
}
if {$schema ne {}} {
    lappend options -schema $schema
}
return [ns_db batchinsert ${:handle} {*}$options $batch]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: