Class: Db
Description
This method permanently removes a record from the database. This method is equivalent to the SQL DELETE statement.
Example SQL DELETE statement:
DELETE DEP WHERE BAL=0 AND STAT=4 AND CID<:CID
As of Profile version 6.3, this method supports lowercase variables, object.property, and system variables within the host variable syntax. PSL maps these variables and object references into uppercase host variables.
To remove multiple records from the database, use the Db.fastDelete method.
Syntax
Db.delete(literal String table,literal String whereClause,
literal String PSQLparameters)
Parameters
table |
A valid database table name. |
whereClause |
A valid SQL WHERE clause. |
PSQLparameters |
A qualifier that changes the actions within the filer. Valid switches include:
|
Returns
Void
When Became Available
v6.0
Example
The following example deletes the last record in the UTBLBRCD table (i.e. the highest branch code). This example should be tested after testing the Record.bypassSave() example.
set BRCD=Db.currVal(“UTBLBRCD”)
do Db.delete(“UTBLBRCD”,”BRCD=:BRCD”)