updateRandom Transaction Format

About updateRandom Transaction Format

updateRandom transction format updates information for an object in the specified class. Includes all pointer, attachment, note and permission, for that object.


Syntax

updateRandom class-name {
key {
(field1) = "str1" fd
(field2) = "str2" fd
...
(fieldN) = "strN" fd
[objectPtr pointer-name {
class = class-name fd
(field1) = "str1" fd
(field2) = "str2" fd
...
(fieldN) = "strN" fd
}]
}
[(field1) = "str1" fd
(field2) = "str2" fd
...
(fieldN) = "strN" fd]
[objectPtr pointer-name {
class = class-name fd
(field1) = "str1" fd
(field2) = "str2" fd
...
(fieldN) = "strN" fd
}]
...
}

Explanation

You can use the key statement to provide the primary keys of the object you want to update.

key {
(field1) = "str1" fd
(field2) = "str2" fd
...
(fieldN) = "strN" fd
}
[objectPtr pointer-name {
class = class-name fd
(field1) = "str1" fd
(field2) = "str2" fd
...
(fieldN) = "strN" fd
}]
...
}

If the object you are updating has one or more pointers as primary keys, use one or more objectPtr statements to specify values for these pointers. For class name, specify the class name to which the object is being pointed.

[objectPtr pointer-name {
class = class-name fd
(field1) = "str1" fd
(field2) = "str2" fd
...
(fieldN) = "strN" fd
}]

Use one or more objectPtr statements to supply or change pointer values for the object you are updating. For class name, specify the class name to which the object is being pointed.

[(field1) = "str1" fd
(field2) = "str2" fd
...
(fieldN) = "strN" fd]

Use the remaining fields to provide values for the non-primary key fields, for the object you are updating.

Example

This example updates an object in the User class. The key statement specifies the primary key of the object to be updated. The properties to be changed follow the primary key. This example adds the e-mail address for this user.

updateRandom s_usr_class {
key {
s_usr_name = "John";
}
s_usr_mailaddr= "john@org.com";
}