如果要从数据库中删除某些记录,则需要DELETE操作。 以下程序显示了从AGE超过20的EMPLOYEE中删除所有记录的过程。
/* 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 = "DELETE FROM EMPLOYEE WHERE AGE > 20"