NLI: Function: setRow / setRow+

Background: NLI, Expressions, Functions
Related: Examples, Ex200

Description:
The setRow function creates a row for specified class and relates existing values to predefined columns. The row columns are defined previously via "(set classX column relatorY)" expressions. Similarly, the setRow+ function creates a row for specified class and relates values to predefined columns. Unlike setRow, setRow+ creates specified values if they don't already existing in db. For setRow+, column values are specified by strings.

General Format:
(setRow class value1 [value2] ...)
(setRow+ class 'value1 ['value2] ...)

Examples:
(; Setup columns to be added by setRow)
(set person column name)
(set person column gender)
(set person column age)

(setRow+ person 'john 'male '30)
(setRow+ person 'mary 'female '25)

Notes:
setRow function is similar to the INSERT command in SQL.

CM ©2000-2007