getPK {maDB}R Documentation

Getting the primary key of the appropriate object from the database

Description

This function is intended to get the primary key of an object from the database. If in the corresponding database table no entry with the same attribute values (as the object submitted) exists, the values will be inserted into the ddatabase and the primary key of the new entry will be returned. So basically this method should check if the object exists in the database and return its primary key when it does. If the entry does not exist it inserts it and returns the new primary key.

Usage

getPK(object, Con, table.name = NULL, all.fields = FALSE, ...)

Arguments

object The data object.
Con The connection to the database.
table.name The database table name where objects from the type of the submitted objects are stored into.
all.fields If all attributes have to match between the database entry and the object submitted.
... some additional things.

Value

The primary key of the database entry.

Author(s)

Johannes Rainer

Examples






[Package maDB version 1.8.0 Index]