appds_delete_record
status.i4.v = appds_delete_record(table_name.i1a.r, select_value.g.v,
recs_requested.i4.v,
recs_deleted,i4.r,
error_text.i1a.r, db_name.i1a.r,
db_server.i1a.r)
This routine will delete one or more APPDS records from the specified
table. If multiple records are to be deleted, ALL transactions must
complete without error, e.g. SQL errors. Which and how many records
are deleted is determined as follows:
for sequential access: record access mode is set to APPDS_SEQ
---------------------
The deletion of records is determined by the location of the read/write
pointer. If a non-NULL value is passed for the select_value then the
read/write pointer is reset to the top of the table before deletion
starts. The number of record(s) deleted is equal to the amount
specified in num_items. After the records are deleted the read/write
pointer is set to the previous record of its initial record location,
if one exists, otherwise it is set to the top of the table.
Note - The routine will return a failure if the value given in
"recs_requested" is greater then the number of records that
follow the initial record.
table_name name of the APPDS table
select_value NULL value indicates that deletion starts at the last
accessed record, Non-NULL value starts deletion at
first record.
recs_requested requested number of records, at least 1, to delete
from the APPDS table
recs_deleted number of records deleted from the APPDS table
error_text a pointer to a buffer to where any error messages are
placed (NULL indicates that no error text is wanted)
db_name name of the database where the APPDS table is found
(if NULL the default value of APPDS_DEFAULT_DB is used)
db_server name of the database server
(if NULL the default value of APPDS_DEFAULT_SERVER
is used)
for indexed access: record access mode is set to APPDS_INDX
------------------
The select_value is an array of int integers ( 4 Bytes ), each element
in the array represents a record ID. The num_items variable is the
exact number of elements in the array. The routine will attempt to
delete each record from the APPDS table based on the select_value.
On completion the num_items variable is set to the number of records,
removed and the read/write pointer is set to the top of the table.
table_name name of the APPDS table
select_value an array of int integers (4 bytes), one for each
record to be deleted.
recs_requested requested number of records, at least 1, to delete
from the APPDS table. (this valuse must equal the
number of elements in the select_value array)
recs_deleted number of records deleted from the APPDS table
error_text a pointer to a buffer to where any error messages are
placed (NULL indicates that no error text is wanted)
db_name name of the database where the APPDS table is found
(if NULL the default value of APPDS_DEFAULT_DB is used)
db_server name of the database server
(if NULL the default value of APPDS_DEFAULT_SERVER
is used)
for keyed access: record access mode is set to APPDS_KEY
-----------------
The select_value variable is the key for which all records are compared
against and all matching record will be deleted. The number of records
deleted is placed in the num_items. On completion the read/write pointer
is set to the top of the table.
table_name name of the Data Storage table
select_value a single selection key value (Non-Null value)
recs_requested not used for keyed access
recs_deleted number of records deleted from the APPDS table
error_text a pointer to a buffer to where any error messages are
placed (NULL indicates that no error text is wanted)
db_name name of the database where the APPDS table is found
(if NULL the default value of APPDS_DEFAULT_DB is used)
db_server name of the database server
(if NULL the default value of APPDS_DEFAULT_SERVER
is used)
This function returns ACNET status values as follows:
APPDS_SUCCESS requested records were delete
APPDS_TBLRO table set to Read Only, attempt made to modify
APPDS_INVARG invalid argument type
APPDS_MEMFAIL failed to allocate memory
SQL_xxx system error occurred
This function requires the following include files:
appds_h, clib_h, acnet_errors_h
Related functions:
appds_free_table_cache, appds_get_inter_mode, appds_set_inter_mode,
appds_read_record, appds_write_record, appds_key_match_count,
appds_set_db_timeout, appds_get_db_timeout
C/C++ usage:
usage example