任何数据库上的UPDATE操作都意味着更新一个或多个已在数据库中可用的记录。 以下过程将SEX的所有记录更新为“M”。
在下面的例子中,我们将所有男性的年龄增加一年。
/* Main program */
Call RxFuncAdd 'SQLLoadFuncs', 'rexxsql', 'SQLLoadFuncs'
Call SQLLoadFuncs
if SQLConnect(c1,'testuser','test123','testdb') == 0 then say 'Connect Succedded'
if SQLCommand(u1,"use testdb") == 0 then say 'Changed database to testdb'
sqlstr = "UPDATE EMPLOYEE SET AGE = AGE + 1 WHERE SEX = 'M'"
say SQLCommand(c2,sqlstr)