GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SQL::Maker::Plugin::InsertOnDuplicate(3) User Contributed Perl Documentation SQL::Maker::Plugin::InsertOnDuplicate(3)

SQL::Maker::Plugin::InsertOnDuplicate - INSERT ... ON DUPLICATE KEY UPDATE

    package My::QueryBuilder;
    use parent qw/SQL::Maker/;
    __PACKAGE__->load_plugin('InsertOnDuplicate');

    package main;
    my $qb = My::QueryBuilder->new(driver => 'mysql');
    $qb->insert_on_duplicate('member', { email => 'foo@exapmle.com', name => $name }, { name => $name });

This is a plugin to generate "INSERT ... ON DUPLICATE KEY UPDATE" query for MySQL.

This plugin adds only one method for your query builder class.
$query_builder->insert_on_duplicate($table_name:Str, $insert_values:HashRef, $update_values:HashRef)
Generate "INSERT ... ON DUPLICATE KEY UPDATE ...".

$table_name is table name to operate.

$insert_values is values to insert.

$table_name and $insert_values are passing to "SQL::Maker#insert"

$update_values is SET part for ON DUPLICATE KEY UPDATE. It's processed by "SQL::Maker#make_set_clause".

<http://dev.mysql.com/doc/refman/5.6/en/insert-on-duplicate.html>
2014-12-22 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.