Dbscatter()

From Recital Documentation Wiki
Revision as of 09:51, 2 April 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PURPOSE

split the record buffer into individual field buffers


SYNOPSIS

#include "dbl.h"
 
	int	dbscatter(dbf, record, fldbuf)
 
	<input parameters>
 
	char	*dbf;			/* Database file descriptor	*/
	char	record[1000];		/* Record buffer		*/
	char	fldbuf[128][256];	/* Field buffers to fill		*/
 
	<output parameters>
 
	none


RETURN VALUE

The dbscatter() function returns 0 for success. Refer to the section on return codes for a detailed list of return code definitions.


DESCRIPTION

The dbscatter() function "scatters" the specified record, retrieved with dbgetr()/dbgetrk(), into individual field buffers. The command is similar to The dbrecout() function with the exception that it requires fewer input parameters.

EXAMPLE

The following example "scatters" the record stored in 'char record[1000]' into the specified field buffers (fldbuf[128][256]).

#include "dbl.h"
 
	char	*dbf;			/* Database file descriptor	*/
	char	record[1000];		/* Record buffer		*/
	char	fldbuf[128][256];	/* Field buffers to fill		*/
 
	rc = dbscatter(dbf, record, fldbuf);
	if ( rc != 0 )  {
		printf("Error scattering record; %dn", rc);
		exit(1);
	} else {
		printf("Record scattered!n");
	}

</code>


SEE ALSO

dbfield(), dbgather(), dbgetr(), dbgetrk(), dbrecout()