Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
SQL::Maker::Plugin::InUserOContributedSPL::Maker::Plugin::InsertOnDuplicate(3)

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

SYNOPSIS
	   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 });

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

METHODS
       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".

SEE ALSO
       <http://dev.mysql.com/doc/refman/5.6/en/insert-on-duplicate.html>

perl v5.32.1			  2014SQL::Maker::Plugin::InsertOnDuplicate(3)

NAME | SYNOPSIS | DESCRIPTION | METHODS | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=SQL::Maker::Plugin::InsertOnDuplicate&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help