copy2child()

Purpose

Copies the fields of a parent record to the fields of its child record. This function is regarded as obsolete in 4.500

Syntax (CCOWN)

int copy2child(short * from_record, short * to_record, role)

Syntax (DP4DBAPI)

BOOLEAN dp4_copy2child(DCONN * dconn,short *to_record,short *from_record,const char *role);

Parameters

short DP4P from_record

Pointer to L field of parent record

 

short DP4P to_record

Pointer to L field of child record

 

const char DP4P role

Role of index

Description

The copy2child() function copies the key fields of the given parent's child index from the parent record to the child. This involves a call to the database manager to perform the field transcriptions so it is inefficient, particularly in networking applications. Normally, the transfer is explicitly done in the program.

This function has the advantage that it remains valid if the child index details of the parent are changed.

Note that the order of the from and to parameters is interchanged between the DP4DBAPI and OWN variants of this function.

Return values

Returns FALSE if the key fields are already the same, otherwise TRUE

See also

copy2parent(), rec_child_copy(), rec_parent_copy()