Rexx - UPDATE 更新操作

任何数据库上的 UPDATE 操作都意味着更新数据库中已有的一条或多条记录。 以下过程更新所有 SEX 为"M"的记录。

在下面的示例中,我们将所有男性的 AGE 增加一岁。

示例

/* 主程序 */
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)

❮ rexx_databases.html