Explorar o código

Fixed bug in insert with currval

ficklin %!s(int64=12) %!d(string=hai) anos
pai
achega
1f7f8ce38d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      tripal_core/api/tripal_core.api.inc

+ 1 - 1
tripal_core/api/tripal_core.api.inc

@@ -356,7 +356,7 @@ function tripal_core_chado_insert($table, $values, $options = array()) {
         $psql = "PREPARE currval_" . $table . "_" . $field . " AS SELECT CURRVAL('" . $table . "_" . $field . "_seq')";
         $is_prepared = tripal_core_chado_prepare("currval_$table", $psql, array());
         if ($is_prepared) {
-           $value = db_fetch_object(chado_query("EXECUTE currval_$table"));
+           $value = db_result(chado_query("EXECUTE currval_" . $table. "_" . $field));
         }
         else {
           $sql = "SELECT CURRVAL('" . $table . "_" . $field . "_seq')";