Specify the VALUES clause of this UPDATE statement with an explicit parameter ordering that will be maintained in the SET clause of the resulting UPDATE statement. E.g.:: stmt = table.update().ordered_values(("name", "ed"), ("ident", "foo")) .. seealso:
(self, *args: Tuple[_DMLColumnArgument, Any])
| 1678 | super().__init__(table) |
| 1679 | |
| 1680 | def ordered_values(self, *args: Tuple[_DMLColumnArgument, Any]) -> Self: |
| 1681 | class="st">"""Specify the VALUES clause of this UPDATE statement with an explicit |
| 1682 | parameter ordering that will be maintained in the SET clause of the |
| 1683 | resulting UPDATE statement. |
| 1684 | |
| 1685 | E.g.:: |
| 1686 | |
| 1687 | stmt = table.update().ordered_values((class="st">"name", class="st">"ed"), (class="st">"ident", class="st">"foo")) |
| 1688 | |
| 1689 | .. seealso:: |
| 1690 | |
| 1691 | :ref:`tutorial_parameter_ordered_updates` - full example of the |
| 1692 | :meth:`_expression.Update.ordered_values` method. |
| 1693 | |
| 1694 | .. versionchanged:: 1.4 The :meth:`_expression.Update.ordered_values` |
| 1695 | method |
| 1696 | supersedes the |
| 1697 | :paramref:`_expression.update.preserve_parameter_order` |
| 1698 | parameter, which will be removed in SQLAlchemy 2.0. |
| 1699 | |
| 1700 | class="st">""" class="cm"># noqa: E501 |
| 1701 | if self._values: |
| 1702 | raise exc.ArgumentError( |
| 1703 | class="st">"This statement already has " |
| 1704 | fclass="st">"{&class="cm">#x27;ordered ' if self._maintain_values_ordering else ''}" |
| 1705 | class="st">"values present" |
| 1706 | ) |
| 1707 | |
| 1708 | self = self.values(dict(args)) |
| 1709 | self._maintain_values_ordering = True |
| 1710 | return self |
| 1711 | |
| 1712 | @_generative |
| 1713 | def inline(self) -> Self: |