Rexx - 更新操作



任何資料庫上的 UPDATE 操作是指更新資料庫中已有的一個或多個記錄。以下過程將更新所有 SEX 為 'M' 的記錄。

以下示例中,我們將所有男性的 AGE 增加一年。

示例

/* 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)
rexx_databases.htm
廣告
© . All rights reserved.