Programming Guide



sm_tm_handling

Processes a handling method property

#include <tmusubs.h>
int sm_tm_handling(int prop);

prop
One of the property constants.

Returns

Description

sm_tm_handling analyzes and, in some cases, processes the handling specified (indirectly) by the prop parameter for the specified table view. If the parameter is DM_SEL_FUNC_NAME, DM_INS_FUNC_NAME, DM_UPD_FUNC_NAME or DM_DEL_FUNC_NAME, the handling is that of the corresponding PR_xxx_HANDLING property. If prop is DM_CONTINUE_FUNC_NAME, the choice of behavior is based on DM_SELECT_HANDLING, but the function invoked, if any, is the CONTINUE function. If prop is DM_SAVE_FUNC_NAME, the function (if any) specified by that property is invoked if any of the insert, update or delete handling properties specify function invocation. Otherwise TM_OK is returned.

If the property value specifies to do nothing, this routine simply returns TM_OK.

If the property value specifies to invoke a function, this routine calls it; the function has no parameters. If the function returns a non-zero integer, and the TM_STATUS member of sm_tm_curinfo is zero, this routine puts that value there; it similarly proposes a generalized error message, if none has been set up. The return value from this routine is TM_FAILURE (for an error on the function call or a non-zero return from the function), or TM_OK for a successful call with a zero value returned by the function. Absence of the corresponding function name value is an error, except for CONTINUE and SAVE functions. However, inability to find a function whose name has been specified as a property value is always an error. For this and other serious processing errors in function invocation, this routine reports an error and displays an error message.

Otherwise this routine returns TM_PROCEED.

Since the handling properties are stored internally as strings, the property API access functions are used to get the more convenient PV_ integers.

If dm_tm_listing_sql is being done, this routine always returns TM_PROCEED.