Skip to main content
Version: 6.1

Update

Updates one or more records in the specified Database Table.

Action available for the following operating systems:

OS Supported: Android, iOS, Win, Win32

Parameters​

  • Table - Database Table to update the record(s).
  • Values <string> or <numeric> - Value to assign to the specified Column. This expression will be evaluated accordingly with the Type column.
  • Ignore Database Masks - If you've defined an Output Mask for the specified Column in the Table properties and:
    • This option is checked - You must specify the value in the Kalipso format.
    • This option is unchecked - You must specify the value in the Mask format.
  • Duplicate Quotes - Check this option to automatically duplicate the quote (') character on the Values specified, to correctly insert the record in the database. For further information take a look at the examples below.
  • Where <Kalipso Filter> or <string> - Condition to specify which records should be updated. Check Expressions chapter for more information about Kalipso Filter and String expressions. If this parameter is empty, an error may occur, if you have selected Prevent the execution of Update/Delete Statemens without Where clause in "Online" or "Offline", defined in the Project Properties. To bypass this safety feature without unchecking the options check Example 5.

Usage​

This function generates an Update operation that exists in every SQL database, and is used to update the database according to some condition.

Consider the following Database Table:

Products

Code Numeric

Name String

Stock Numeric

1Coca Cola100
2Pepsi Cola200
3Pork Chops300

Example 1

TableProducts
ColumnsTypeValues
CodeNumeric100
NameString"Coca Cola 'Updated"
StockNumeric400
Duplicate QuotesNo
WhereFIELD(Products,Code)=1

Result:

Products
CodeNameStock
1Coca Cola100
2Pepsi Cola200
3Pork Chops300
warning

It originates a syntax error because parameter Duplicate Quotes is unchecked.

Example 2

TableProducts
ColumsTypeValues
CodeNumeric100
NameString"Coca Cola 'Updated"
StockNumeric400
Duplicate QuotesYes
WhereFIELD(Products,Code)=1

Result:

Products
CodeNameStock
100Coca Cola 'Updated400
2Pepsi Cola200
3Pork Chops300

Example 3

TableProducts
ColumnsTypeValues
CodeNumeric
NameString
StockNumeric5000
Duplicate QuotesNo
WhereFIELD(Products,Code) LIKE "%Cola"

Result:

Products
CodeNameStock
1Coca Cola5000
2Pepsi Cola5000
3Pork Chops3000

Example 4

TableProducts
ColumsTypeValues
CodeNumeric003
NameString"Pork Chops"
StockNumeric1000
Duplicate QuotesYes
WhereFIELD(Products,Code)=3

Result:

Products
CodeNameStock
1Coca Cola100
2Pepsi Cola200
3Pork Chops1000

Example 5

TableProducts
ColumnsTypeValues
CodeNumeric
NameString
StockNumeric0
Duplicate QuotesNo
Where1=1

Result:

Products
CodeNameStock
1Coca Cola0
2Pepsi Cola0
3Pork Chops0
info

When you specify more than one condition in Where parameter, the operator used between the conditions is "AND" or "OR".