OpenTP1 Version 7 Programming Reference C Language

[Contents][Index][Back][Next]

dc_tam_rewrite - Update a TAM table record on the assumption of input

Format

ANSI C, C

#include <dctam.h>
int  dc_tam_rewrite (DCLONG tblid, struct DC_TAMKEY
                     *keyadr, int keyno, char *datadr,
                     int datsize, DCLONG flags)

K&R C

#include <dctam.h>
int  dc_tam_rewrite (tblid, keyadr, keyno, datadr, datsize,
                     flags)
DCLONG    tblid;
struct DC_TAMKEY *keyadr;
int       keyno;
char      *datadr;
int       datsize;
DCLONG    flags;

Description

The function dc_tam_rewrite() updates and outputs a record input by the function dc_tam_read.

Once the function dc_tam_read() is called to input a record for update processing, the function dc_tam_rewrite() can be called any number of times before the synchronization point of the transaction is acquired. However, the function dc_tam_rewrite() cannot be called after the function dc_tam_delete() or dc_tam_read_cancel().

If the function dc_tam_rewrite() returns with an error, all the resources specified within this function are released, and the status before this function was called is regained.

When a request is made to update multiple specified records, even if one of the records causes an error, the processing of all the records specified in this function results in an error.

The key value storage location in the update data and the key area length are as specified in the tamcre command used for creation of a TAM table file.

The data part has a key value if the key value is assigned to the data part (the -s option not specified in the tamcre command) when a TAM table file is created. Therefore, an error is returned if the key value specified in the function dc_tam_rewrite() is not found in the update data. The data part has no key value if no key value is assigned to the data part (the -s option specified in the tamcre command). In this case, no check is made on the contents of the update data.

Arguments whose values are set in the UAP

tblid

Specify the table descriptor of the TAM table whose record is to be updated. The table descriptor is the value returned with the function dc_tam_open().

keyadr

Specify the address of the structure having the address of the key value of the record to be updated. The structure format is as follows:

struct DC_TAMKEY {
                  char *keyname;
                 };

keyno

Specify the number of request records (number of structures specified for keyadr).

datadr

Specify the address of the update data.

datsize

Specify the length of the update data. The update data length must be equal to or greater than (record length x number of request records).

flags

Specify DCNOFLAGS.

Return values

Return value Return value (numeric) Explanation
DC_OK 0 The TAM table record was updated normally.
DCTAMER_PARAM_TID -1700 The table descriptor specified for tblid is invalid.
DCTAMER_PARAM_KEY -1702 The key value specified for keyadr is invalid.
DCTAMER_PARAM_KNO -1703 The value specified for keyno is invalid.
DCTAMER_PARAM_DTA -1706 The value specified for datadr is invalid.
DCTAMER_PARAM_DTS -1707 The data length specified for datsize is too short.
DCTAMER_PARAM_FLG -1708 The value specified for flags is invalid.
DCTAMER_NOTTAM -1709 The table specified for tblid is not a TAM table.
DCTAMER_TAMEND -1720 The TAM service is being terminated.
DCTAMER_PROTO -1721 The sequence of accessing the TAM table is invalid.
The resource manager registration of the object file for transaction control having a linkage with the UAP is invalid.
Alternatively, there is no linkage between the object file for transaction control and the UAP.
atomic_update=N (nontransaction attribute) is specified in the user service definition of the UAP which called the function.
DCTAMER_RMTBL -1723 The TAM table was deleted.
DCTAMER_NOLOAD -1724 The TAM table was not loaded.
DCTAMER_NOOPEN -1726 The TAM table is not open.
DCTAMER_LOGHLD -1727 The TAM table is in logical shutdown state.
DCTAMER_OBSHLD -1728 The TAM table is in shutdown state due to an error.
DCTAMER_NOREC -1731 The specified record does not exist.
DCTAMER_SEQENCE -1732 The function dc_tam_read() was not called.
DCTAMER_TBLVR -1760 The version of the TAM library linked to the UAP does not allow the UAP to operate with the current TAM table.
DCTAMER_FLSVR -1761 The version of the TAM library linked to the UAP does not allow the UAP to operate with the current OpenTP1 file service.
DCTAMER_RECOBS -1764 The record has been damaged.
DCTAMER_TRNNUM -1765 The number of transactions exceeds the maximum number of transactions which can be managed by the TAM service.
DCTAMER_OPENNUM -1766 The number of open character special files exceeds the specified limit.
DCTAMER_ACCESSS -1767 The access permission for special files has not been granted.
DCTAMER_ACCESSF -1768 The access permission for TAM files has not been granted.
DCTAMER_MEMORY -1769 The memory became insufficient.
DCTAMER_IO -1770 An input/output error occurred.
DCTAMER_TMERR -1771 A transaction service error occurred.