• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/db/connection.php
  • Класс: BitrixMainDBConnection
  • Вызов: Connection::getInsertedId
public function getInsertedId();

/**
 * Parses the string containing multiple queries and executes the queries one by one.
 * Queries delimiter depends on database type.
 * @see SqlHelper->getQueryDelimiter
 *
 * @param string $sqlBatch String with queries, separated by database-specific delimiters.
 * @param bool $stopOnError Whether return after the first error.
 * @return array Array of errors or empty array on success.
 */
public function executeSqlBatch($sqlBatch, $stopOnError = false)
{
	$result = [];
	foreach ($this->parseSqlBatch($sqlBatch) as $sql)
	{
		try
		{
			$this->queryExecute($sql);
		}
		catch (SqlException $ex)
		{
			$result[] = $ex->getMessage();
			if ($stopOnError)
			{
				return $result;
			}
		}
	}

	return $result;
}