QueryUpdate: Update Query.

QueryUpdateR Documentation

Update Query.

Description

Update Query.

Update Query.

Details

This class represents an SQL UPDATE query. See the make_update() factory function to create more easily an UPDATE query object.

Super class

sqlq::Query -> QueryUpdate

Methods

Public methods

Inherited methods

Method new()

Initializer.

Usage
QueryUpdate$new(up, set)
Arguments
up

A StmtUpdate instance.

set

A StmtSet instance.

Returns

Nothing.


Method clone()

The objects of this class are cloneable with this method.

Usage
QueryUpdate$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

make_update

Examples

# To generate a simple UPDATE query:
where <- StmtWhere$new(ExprBinOp$new(
  ExprField$new("year"), "<",
  ExprValue$new(2010)
))
set <- make_set(price = 9.50, old = TRUE)
update <- QueryUpdate$new(StmtUpdate$new('books'), set = set)
update$add(where)


sqlq documentation built on Sept. 16, 2025, 9:10 a.m.