deleteDBEntry {pgUtils}R Documentation

Deleting a row (or all rows) in a database table

Description

deleteDBEntry With this function a row or all rows can be deleted from a database table. If the rows to be deleted are referenced by another table the corresponding row will not be deleted (to keep the referencial integrity).

Usage

deleteDBEntry(con,name=NULL,attribute=NULL,value=NULL,condition="=", no.transaction=FALSE)

Arguments

con A connection object (create it with the dbConnect.PgSQL.conn function from the package RdbiPgSQL)
name The table name
attribute The column name in the database where the values in the values argument can be found (the corresponding rows will then be deleted).
value The values that should be compared with the entries in the column of the database table (specified by the attribute argument). If nothing is submitted, all rows in the database will be deleted.
condition The condition that has to be fulfilled by the values (submitted with the value argument and the values in the database table, specified by the attribute column).
no.transaction if the whole call should not be performed into a TRANSACTION, so if any error occurrs during the processing of the function, the database will not be touched. The default value is FALSE, so the function is quite robust.

Details

For the people that know already a little bit of SQL, this function does nothing else as sending the query DELETE FROM <name> WHERE <attribute><condition><value>;.

Author(s)

Johannes Rainer

References

See Also

createDBTable

Examples






[Package pgUtils version 1.10.0 Index]