appds_write_record

	status.i4.v = appds_write_record(table_name.i1a.r, write_type.i4.v,
					 recs_in_buffer.i4.v, input_buffer.g.v,
					 select_value.g.v, error_text.i1a.r,
					 db_name.i1a.r, db_server.i1a.r)

	This routine will write one or more records to a APPDS table.  Based
	on the write type [APPDS_ADD, APPDS_UPDATE] specified and the access
	mode [ APPDS_SEQ, APPDS_INDX, APPDS_KEY ] for the table a new record
	will be created or an existing record will be updated. When
	multi-records are to be updated or added all operations are grouped
	and performed as one.  If any operation in the group fails all
	actions are aborted and an error is returned.  

 	for sequential access:	record access mode is set to APPDS_SEQ
	---------------------
	In sequential access mode all record(s) that are to be added are
	inserted at the end of the given APPDS table. When records are to be
	updated the select_value variable is used to determine where updating
	should start.  By passing in a NULL value for select_value the routine
	will update records starting after the last records access; current
	location of the read/write pointer.  Otherwise, a non-NULL value
	indicates that updating should start at the top.  If there are more
	records in the input buffer than can be updated, e.g. accessing past
	the last record in the table, an error is returned.  Upon completion
	the location of the read/write pointer is set to the beginning of the
	table when records are added and is set to the last records modified
	when records are updated.

	table_name	name of the APPDS table
	write_type	type of write action to perform
			(APPDS_ADD or APPDS_UPDATE)
	recs_in_buffer	number of record in the input buffer, at least 1
			and maximum = 20
	input_buffer	buffer containing the data to be written 
	select_value	indicates which records to update, ignored when adding 
			records (NULL, start writing with the last record 
			accessed)
			(Non-NULL, reset the read/write pointer to the top, 
			 and start writing with the first record.
	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
 	----------------
	When adding or updating record(s) the select_value variable is used to 
	indicate the record ID for where the data is to be placed. For multiple 
	records the select_value will indicate the record ID for the first
	record with the other records following sequentially.  The data type
	for the select value should be a pointer to a LONG.  For record(s)
	that are ADDed the select_value can be NULL, indicating the records
	are to be appended.  Since indexed access allows records to be added
	any where in the APPDS table there is the potential for overwriting
	existing records.  Overwriting is only allowed if the Data Storage
	table is set to allow it; overwrite field is true.  Upon completion
	the location of the read/write pointer is set to the beginning of
	the table.

	table_name	name of the APPDS table
	write_type	type of write action to perform
			(APPDS_ADD or APPDS_UPDATE)
	recs_in_buffer	number of record in the input buffer, at least 1
			and maximum = 20
	input_buffer	buffer containing the data to be written 
	select_value	record index for the record to modify. Can be NULL only 
			when adding records to indicate that record(s) are to
			be appended, otherwise NULL values are NOT allowed
	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
	-----------------
	In keyed access mode all record(s) that are to be added are inserted
	at the end of the table.  When records are to be updated the
	select_value variable is used to specify the selection "KEY" value
	for which matching records will be update with the new data.  The
	key column for an APPDS table is the first element of the record.
	However for records where the first element is an array, Keyed
	is NOT allowed. Also the input buffer should only contain
	one record, all other record data is ignored.  Upon completion the
	location of the read/write pointer is set to the beginning of the
	table.

	table_name	name of the APPDS table
	write_type	type of write action to perform
			(APPDS_ADD or APPDS_UPDATE)
	recs_in_buffer	number of record in the input buffer (for adds minimum 
			1 and maximum 20 , for updates only 1)
	input_buffer	buffer containing the data to be written 
	select_value	for updates it is the key value, otherwise on adds it 
			is ignored
	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:

	OK			requested records were delete
	APPDS_MAXREC		attempt to add or update records beyond table 
				limits
	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_delete_record, appds_key_match_count,
	appds_set_db_timeout, appds_get_db_timeout

	C/C++ usage:

	usage example