Difference between revisions of "REPLACE()"
From Lianjapedia
Yvonne.milne (Talk | contribs) m (1 revision) |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Function to replace fields in the current record buffer without re-reading the current record | Function to replace fields in the current record buffer without re-reading the current record | ||
− | |||
==Syntax== | ==Syntax== | ||
REPLACE(<field>,<exp>) | REPLACE(<field>,<exp>) | ||
− | |||
==See Also== | ==See Also== | ||
− | + | [[REPLACE]] | |
− | + | ||
==Description== | ==Description== | ||
− | The REPLACE() function allows fields in the current record buffer to be modified without re-reading the record. The REPLACE function will update the <field> with the value stored in <exp>. The <exp> must be the same data type as the <field> being replaced | + | The REPLACE() function allows fields in the current record buffer to be modified without re-reading the record. The REPLACE function will update the <field> with the value stored in <exp>. The <exp> must be the same data type as the <field> being replaced. The REPLACE() function replaces data in the active record buffer, these changes are not written to disk until action is taken to commit the record. The REPLACE command is unlike the REPLACE() function, in that changes to the active record buffer are written to disk immediately. |
− | + | ||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | + | use accounts | |
replace(time, time()) | replace(time, time()) | ||
replace(use, getenv("username")) | replace(use, getenv("username")) | ||
replace(date, date()) | replace(date, date()) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] |
Latest revision as of 09:22, 16 November 2011
Contents
Purpose
Function to replace fields in the current record buffer without re-reading the current record
Syntax
REPLACE(<field>,<exp>)
See Also
Description
The REPLACE() function allows fields in the current record buffer to be modified without re-reading the record. The REPLACE function will update the <field> with the value stored in <exp>. The <exp> must be the same data type as the <field> being replaced. The REPLACE() function replaces data in the active record buffer, these changes are not written to disk until action is taken to commit the record. The REPLACE command is unlike the REPLACE() function, in that changes to the active record buffer are written to disk immediately.
Example
use accounts replace(time, time()) replace(use, getenv("username")) replace(date, date())