Executes a list of given SQL statements.

@param array $list List of SQL statement to execute
@param string $name Name from the resource configuration
432000
protected function _executeList( array $list, $name = 'db' )
	{
		$conn = $this->_getConnection( $name );

		foreach( $list as $sql ) {
			$conn->create( $sql )->execute()->finish();
		}
	}
90320
def _execute_sql(sql, is_batch, args)
    result = []
    if sql
      #puts "RhomDbAdapter: Executing query - #{sql}; #{args}"
      begin
        result = @database.execute( sql, is_batch, args )
        #puts "result : #{result}"
      rescue Exception => e
        puts "exception when running query: #{e}"
        puts "query: #{sql}"
        raise
      end
    end
    result
  end
627671
private function projectList(UserList $list)
    {
        $statement = $list->deliverQueryObject()->execute();

        foreach ($statement as $result) {
            $user = $list->getResult($result);
            yield iterator_to_array($this->projectUser($user));
        }
    }
735360
protected function prepareListOrderAccount(array &$list)
    {
        foreach ($list as &$item) {
            $this->setItemTotalFormatted($item, $this->price);
            $this->setItemOrderAddress($item, $this->address);
            $this->setItemOrderStoreName($item, $this->store);
            $this->setItemOrderStatusName($item, $this->order);
            $this->setItemOrderPaymentName($item, $this->payment);
            $this->setItemOrderShippingName($item, $this->shipping);
        }
    }
671835
public function sqlStateIn($state, $list) {
		$stateMap = array(
			'42S02'=>RedBean_QueryWriter::C_SQLSTATE_NO_SUCH_TABLE,
			'42S22'=>RedBean_QueryWriter::C_SQLSTATE_NO_SUCH_COLUMN,
			'23000'=>RedBean_QueryWriter::C_SQLSTATE_INTEGRITY_CONSTRAINT_VIOLATION
		);
		return in_array((isset($stateMap[$state]) ? $stateMap[$state] : '0'),$list); 
	}
732285
public function execute($row, $name = null)
    {
        parent::execute($row, $name);
        return $row[MemberNames::LINK_ID];
    }
98818
protected function appendListItem($name, $key)
    {
        $list = $this->getList($name);
        $list[] = $key;
        $this->cache->set($name, $list, 0);
    }
1212847
public function execute($row, $name = null)
    {

        // load the field names
        $keys = array_keys($row);

        // create a unique name for the prepared statement
        $name = sprintf('%s-%s', $name, md5(implode('-', $keys)));

        // query whether or not the statement has been prepared
        if (!$this->hasPreparedStatement($name)) {
            // initialize the array for the primary key fields
            $pks = array();
            // load the last value as PK from the array with the keys
            $pks[] = $keys[array_search(MemberNames::ITEM_ID, $keys, true)];

            // remove the entity status and the primary key from the keys
            unset($keys[array_search(MemberNames::ITEM_ID, $keys, true)]);
            unset($keys[array_search(EntityStatus::MEMBER_NAME, $keys, true)]);

            // prepare the SET part of the SQL statement
            array_walk($keys, function (&$value, $key) {
                $value = sprintf('%s=:%s', $value, $value);
            });

            // prepare the SET part of the SQL statement
            array_walk($pks, function (&$value, $key) {
                $value = sprintf('%s=:%s', $value, $value);
            });

            // create the prepared UPDATE statement
            $statement = sprintf($this->loadStatement(SqlStatementKeys::UPDATE_STOCK_ITEM), implode(',', $keys), implode(',', $pks));

            // prepare the statement
            $this->addPreparedStatement($name, $this->getConnection()->prepare($statement));
        }

        // pass the call to the parent method
        return parent::execute($row, $name);
    }
83512
public void execute(final Collection<T> targets, final ForceExecuteCallback<T> callback) throws SQLException {
        Collection<SQLException> exceptions = new LinkedList<>();
        for (T each : targets) {
            try {
                callback.execute(each);
            } catch (final SQLException ex) {
                exceptions.add(ex);
            }
        }
        throwSQLExceptionIfNecessary(exceptions);
    }
764586
public function setList(array $list)
    {
        foreach ($list as $item) {
            $this->checkType(TypeDefinitionInterface::class, $item);
        }
        $this->list = $list;
    }
379612
public void execute(String name, Reader sqlCode, PrintWriter out) throws Exception {
        runScript(name, sqlCode, out);
    }
73797
public function plainSelect($name, $list = array(), $selected = null, $options = array())
    {
        return parent::select($name, $list, $selected, $options);
    }
838679
public function addSelectList(string $name, array $items = []): void
    {
        $options = $this->formOptions['fields'][$name];
        $wrapper = $this->createWrapper();
        $label = '';

        if (isset($options['label']['text'])) {
            $label = $this->createLabel($options['label']['text'], $name);

            unset($options['label']['text']);
        }

        $list = HtmlTag::createElement('select')
            ->set('id', $name)
            ->set('name', $name);

        $caption = '';

        if (isset($options['caption']['text'])) {
            $list->set('aria-describedby', $name . '_caption');
            $caption = $this->createCaption($options['caption']['text'], $name);

            unset($options['caption']['text']);
        }

        foreach ($items as $value => $text) {
            $item[] = $list->addElement('option')
                ->set('value', $value)
                ->text($text);
        }

        $elements = [
            'wrapper' => $wrapper,
            'label'   => $label,
            'list'    => $list,
            'item'    => $item ?? [],
            'caption' => $caption
        ];

        foreach ($elements as $name => $element) {
            $$name = $this->assignOptionsToElement($options, $name, $element);
        }

        $wrapper->addElement($label);
        $wrapper->addElement($list);
        $wrapper->addElement($caption);

        echo $wrapper;
    }
827800
protected function listQueryParams(array $list)
    {
        $result = [];
        $params = $this->getRequest()->getQueryParams();
        
        foreach ($list as $key => $value) {
            if (is_int($key)) {
                $key = $value;
                $value = null;
            }
            
            $result[] = isset($params[$key]) ? $params[$key] : $value;
        }
        
        return $result;
    }
772215
protected function prepareListUser(array &$list)
    {
        $stores = $this->store->getList();

        foreach ($list as &$item) {

            $item['url'] = '';

            if (isset($stores[$item['store_id']])) {
                $item['url'] = $this->store->getUrl($stores[$item['store_id']]) . "/account/{$item['user_id']}";
            }
        }
    }
4465
public function renderValue(string $value, string $list) : void
    {
        /**
         * @var \CsvMigrations\Model\Table\DblistsTable
         */
        $table = $this->loadModel('CsvMigrations.Dblists');
        $this->_createList($list);

        $query = $table->find()
            ->enableHydration(true)
            ->where([$table->aliasField('name') => $list])
            ->matching('DblistItems', function ($q) use ($value) {
                return $q->where(['DblistItems.value' => $value]);
            });

        try {
            $entity = $query->firstOrFail();
        } catch (RecordNotFoundException $e) {
            $this->set('data', '' !== trim($value) ? sprintf(ListRenderer::VALUE_NOT_FOUND_HTML, $value) : '');

            return;
        }

        Assert::isInstanceOf($entity, EntityInterface::class);
        $this->set('data', $entity->get('_matchingData')['DblistItems']->get('name'));
    }
992816
private function projectList(EntryList $list)
    {
        $headers = array_keys(iterator_to_array($this->getHeaders($list->getEntity())));
        $statement = $list->deliverQueryObject()->execute();

        foreach ($statement as $result) {
            if ($entry = $list->getResult($result)) {
                yield $this->orderedEntry(iterator_to_array($this->projectEntry($entry)), $headers);
            }
        }
    }