From 544103a05808bd3b44d945b1cc04a1d32bd5e100 Mon Sep 17 00:00:00 2001 From: "Paula V. Quispe" Date: Fri, 26 Feb 2016 14:17:31 -0400 Subject: [PATCH] HOR-290 --- workflow/engine/classes/class.pmFunctions.php | 7 +++++-- workflow/engine/controllers/pmTablesProxy.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index da63e0fdd..30eabd9f8 100755 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -264,8 +264,11 @@ function executeQuery ($SqlStatement, $DBConnectionUID = 'workflow', $aParameter $rs = $con->executeUpdate( $SqlStatement ); $result = $con->getUpdateCount(); $con->commit(); - //$result = $lastId->getId(); - // $result = 1; + break; + case preg_match( "/^REPLACE\s/i", $statement ): + $rs = $con->executeUpdate( $SqlStatement ); + $result = $con->getUpdateCount(); + $con->commit(); break; case preg_match( "/^UPDATE\s/i", $statement ): $rs = $con->executeUpdate( $SqlStatement ); diff --git a/workflow/engine/controllers/pmTablesProxy.php b/workflow/engine/controllers/pmTablesProxy.php index ad51c01f5..d5176815b 100755 --- a/workflow/engine/controllers/pmTablesProxy.php +++ b/workflow/engine/controllers/pmTablesProxy.php @@ -692,7 +692,7 @@ class pmTablesProxy extends HttpProxyController $sErrorMessages = ''; $i = 1; $conData = 0; - $insert = 'INSERT INTO ' . $aAdditionalTables['ADD_TAB_NAME'] . ' ('; + $insert = 'REPLACE INTO ' . $aAdditionalTables['ADD_TAB_NAME'] . ' ('; $query = ''; $swHead = false; while (($aAux = fgetcsv( $oFile, 4096, $_POST['form']['CSV_DELIMITER'] )) !== false) {