int MGOinssubscription (Subscription *sub)
The MGOinssubscription() function inserts a new subscription record. Information is passed through sub. The required and optional fields are:
sub.uwnetid is the uwnetid name. sub.subscription_code is the subscription reference code. sub.subscription_data is the subscription data. sub.permit is a boolean indicating whether the subscription is permitted. sub.permit_by is the validation id of the entity who authorized this permission. sub.permit_source is the validation source reference code. If you enable the permit boolean, you must also specify the permit_by and permit_source fields. sub.permit_exp is the expiration date of this subscription in YYYY-MM-DD form. The same applies to the sub.deny* fields. Note that a deny overrides any permits. sub.notify_code indicates whether the uwnetid has been notified that the subscription is to expire. sub.notify_date is the date of expiration. sub.status_code is the subscription status reference code.
Returns the number of records inserted upon success or -1 if an error occurred (in which case MGOerrno and MGOerrmsg are set appropriately).
wmango
MGOdelsubscription(), MGOselrsubscription(), MGOselsubscription(), MGOselrsubstatus(), MGOupdsubscription(), MGOzero()